From dd3df5da983312d7c73ba4e9d5929b85f81ef7cc Mon Sep 17 00:00:00 2001 From: Guillaume ALLAIS Date: Tue, 7 Dec 2021 17:02:50 +0000 Subject: [PATCH] [ fix ] highlighting 'as' & 'off' keywords --- src/Idris/Parser.idr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Idris/Parser.idr b/src/Idris/Parser.idr index 845d026e0..ecc3187a8 100644 --- a/src/Idris/Parser.idr +++ b/src/Idris/Parser.idr @@ -1203,9 +1203,9 @@ totalityOpt fname <|> (decoratedKeyword fname "total" $> Total) <|> (decoratedKeyword fname "covering" $> CoveringOnly) -logLevel : Rule (Maybe LogLevel) -logLevel - = (Nothing <$ exactIdent "off") +logLevel : OriginDesc -> Rule (Maybe LogLevel) +logLevel fname + = (Nothing <$ decorate fname Keyword (exactIdent "off")) <|> do topic <- optional (split ('.' ==) <$> simpleStr) lvl <- intLit pure (Just (mkLogLevel' topic (fromInteger lvl))) @@ -1222,7 +1222,7 @@ directive fname indents -- atEnd indents -- pure (Hide True n) <|> do decorate fname Keyword $ pragma "logging" - lvl <- logLevel + lvl <- logLevel fname atEnd indents pure (Logging lvl) <|> do decorate fname Keyword $ pragma "auto_lazy" @@ -1757,7 +1757,7 @@ import_ fname indents reexp <- option False (decoratedKeyword fname "public" $> True) ns <- decorate fname Module $ mustWork moduleIdent nsAs <- option (miAsNamespace ns) - (do exactIdent "as" + (do decorate fname Keyword $ exactIdent "as" decorate fname Namespace $ mustWork namespaceId) pure (reexp, ns, nsAs)) atEnd indents @@ -2151,7 +2151,7 @@ loggingArgCmd parseCmd command doc = (names, Args [StringArg, NumberArg], doc, p parse = do symbol ":" runParseCmd parseCmd - lvl <- mustWork logLevel + lvl <- mustWork $ logLevel (Virtual Interactive) pure (command lvl) parserCommandsForHelp : CommandTable