Parser-driven highlighting for if/then/else

Previously, these were not highlighted.
This commit is contained in:
David Raymond Christiansen 2015-08-19 16:23:29 -07:00
parent d9bfa3e5a6
commit 64db2711c3

View File

@ -937,13 +937,14 @@ If ::= 'if' Expr 'then' Expr 'else' Expr
-}
if_ :: SyntaxInfo -> IdrisParser PTerm
if_ syn = (do reserved "if"
if_ syn = (do ifFC <- reservedFC "if"
fc <- getFC
c <- expr syn
reserved "then"
thenFC <- reservedFC "then"
t <- expr syn
reserved "else"
elseFC <- reservedFC "else"
f <- expr syn
mapM_ (flip highlightP AnnKeyword) [ifFC, thenFC, elseFC]
return (PIfThenElse fc c t f))
<?> "conditional expression"