Improved messages for missing spaces in [..]

This commit is contained in:
Vidar Holen 2013-07-10 23:03:42 -07:00
parent 5a3493740e
commit 2214889a36
1 changed files with 2 additions and 4 deletions

View File

@ -268,8 +268,6 @@ readConditionContents single = do
x <- readNormalWord
pos <- getPosition
when (endedWith "]" x) $ do
lookAhead (try $
(many whitespace) >> (eof <|> disregard readSeparator <|> disregard (g_Then <|> g_Do)))
parseProblemAt pos ErrorC $
"You need a space before the " ++ (if single then "]" else "]]") ++ "."
when (single && endedWith ")" x) $ do
@ -305,8 +303,8 @@ readConditionContents single = do
pos <- getPosition
lookAhead (char '[')
parseProblemAt pos ErrorC $ if single
then "Don't use [] for grouping. Use \\( .. \\)."
else "Don't use [] for grouping. Use ()."
then "If grouping expressions inside [..], use \\( ..\\)."
else "If grouping expressions inside [[..]], use ( .. )."
)
(do
pos <- getPosition