mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-22 14:38:20 +03:00
Parser-driven highlighting for if/then/else
Previously, these were not highlighted.
This commit is contained in:
parent
d9bfa3e5a6
commit
64db2711c3
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user