Hacked in place warnings for if [[ 1 ]] then :; fi

This commit is contained in:
Vidar Holen 2012-12-02 23:47:17 -08:00
parent 6e263e6b76
commit 6d2e739e09
1 changed files with 15 additions and 13 deletions

View File

@ -478,6 +478,8 @@ readCondition = called "test expression" $ do
close <- (try $ string "]]") <|> (string "]") close <- (try $ string "]]") <|> (string "]")
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 [[ ?"
spacing
many readCmdWord -- Read and throw away remainders to get then/do warnings. Fixme?
return $ T_Condition id (if single then SingleBracket else DoubleBracket) condition return $ T_Condition id (if single then SingleBracket else DoubleBracket) condition