joinstr acc 0 (x:xs)       | last x == '}' = error $ "unexpected string closing: " ++ (intercalate [] $ reverse acc)
                           | otherwise     = joinstr (x:acc) 0 xs
joinstr acc 0 (x:xs)       | last x == '}' = error $ "unexpected string closing: " ++ (intercalate [] $ reverse acc)
                           | otherwise     = joinstr (x:acc) 0 xs
joinstr acc 0 (x:xs)       | last x == '}' = error $ "unexpected string closing: " ++ (intercalate [] $ reverse acc)
                           | otherwise     = joinstr (x:acc) 0 xs