Improve SC1033/SC1034 message

This commit is contained in:
Vidar Holen 2020-07-27 18:44:07 -07:00
parent 34885142e7
commit cc81bdee31
1 changed files with 2 additions and 2 deletions

View File

@ -945,8 +945,8 @@ readCondition = called "test expression" $ do
cpos <- getPosition cpos <- getPosition
close <- try (string "]]") <|> string "]" <|> fail "Expected test to end here (don't wrap commands in []/[[]])" close <- try (string "]]") <|> string "]" <|> fail "Expected test to end here (don't wrap commands in []/[[]])"
id <- endSpan start id <- endSpan start
when (open == "[[" && close /= "]]") $ parseProblemAt cpos ErrorC 1033 "Did you mean ]] ?" when (open == "[[" && close /= "]]") $ parseProblemAt cpos ErrorC 1033 "Test expression was opened with double [[ but closed with single ]. Make sure they match."
when (open == "[" && close /= "]" ) $ parseProblemAt opos ErrorC 1034 "Did you mean [[ ?" when (open == "[" && close /= "]" ) $ parseProblemAt opos ErrorC 1034 "Test expression was opened with single [ but closed with double ]]. Make sure they match."
optional $ lookAhead $ do optional $ lookAhead $ do
pos <- getPosition pos <- getPosition
notFollowedBy2 readCmdWord <|> notFollowedBy2 readCmdWord <|>