Added better message for missing ]/]]
This commit is contained in:
parent
100fff4835
commit
bb7e844125
|
@ -429,8 +429,14 @@ readCondition = do
|
||||||
then "You need spaces after the opening [ and before the closing ]."
|
then "You need spaces after the opening [ and before the closing ]."
|
||||||
else "You need spaces after the opening [[ and before the closing ]]."
|
else "You need spaces after the opening [[ and before the closing ]]."
|
||||||
condition <- readConditionContents single
|
condition <- readConditionContents single
|
||||||
|
|
||||||
cpos <- getPosition
|
cpos <- getPosition
|
||||||
close <- (try $ string "]]") <|> (string "]")
|
close <- (try $ string "]]") <|> (string "]") <|> do
|
||||||
|
let match = (if single then "]" else "]]")
|
||||||
|
parseProblemAt opos ErrorC $ "Couldn't find matching " ++ match ++ "."
|
||||||
|
parseProblem ErrorC $ "Expected " ++ match
|
||||||
|
fail "condition"
|
||||||
|
|
||||||
when (open == "[[" && close /= "]]") $ parseProblemAt cpos ErrorC "Did you mean ]] ?"
|
when (open == "[[" && close /= "]]") $ parseProblemAt cpos ErrorC "Did you mean ]] ?"
|
||||||
when (open == "[" && close /= "]" ) $ parseProblemAt opos ErrorC "Did you mean [[ ?"
|
when (open == "[" && close /= "]" ) $ parseProblemAt opos ErrorC "Did you mean [[ ?"
|
||||||
return $ T_Condition id (if single then SingleBracket else DoubleBracket) condition
|
return $ T_Condition id (if single then SingleBracket else DoubleBracket) condition
|
||||||
|
|
Loading…
Reference in New Issue