From 64db2711c3fa6f3b4131a1e3c10e3c6674f872cc Mon Sep 17 00:00:00 2001 From: David Raymond Christiansen Date: Wed, 19 Aug 2015 16:23:29 -0700 Subject: [PATCH] Parser-driven highlighting for if/then/else Previously, these were not highlighted. --- src/Idris/ParseExpr.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Idris/ParseExpr.hs b/src/Idris/ParseExpr.hs index 5a4060ac8..c7fbd6541 100644 --- a/src/Idris/ParseExpr.hs +++ b/src/Idris/ParseExpr.hs @@ -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"