X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fhaskell.yaml;h=af406ab8c15f5c582a25b83ae775adab22b1e35e;hb=e420872a270e351653f62756cda24892dc1417c9;hp=d69e46f010ccc024855031019a88743ae615ca35;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/haskell.yaml b/runtime/syntax/haskell.yaml index d69e46f0..af406ab8 100644 --- a/runtime/syntax/haskell.yaml +++ b/runtime/syntax/haskell.yaml @@ -1,24 +1,50 @@ filetype: haskell -detect: +detect: filename: "\\.hs$" rules: + # Keywords - statement: "[ ](as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|qualified|type|where)[ ]" - statement: "(^data|^foreign|^import|^infix|^infixl|^infixr|^instance|^module|^newtype|^type)[ ]" - statement: "[ ](as$|case$|of$|class$|data$|default$|deriving$|do$|forall$|foreign$|hiding$|if$|then$|else$|import$|infix$|infixl$|infixr$|instance$|let$|in$|mdo$|module$|newtype$|qualified$|type$|where$)" + + # Various symbols - symbol: "(\\||@|!|:|_|~|=|\\\\|;|\\(\\)|,|\\[|\\]|\\{|\\})" + + # Operators - symbol.operator: "(==|/=|&&|\\|\\||<|>|<=|>=)" + + # Various symbols - special: "(->|<-)" - symbol: "\\.|\\$" + + # Data constructors - constant.bool: "\\b(True|False)\\b" - constant: "(Nothing|Just|Left|Right|LT|EQ|GT)" + + # Data classes - identifier.class: "[ ](Read|Show|Enum|Eq|Ord|Data|Bounded|Typeable|Num|Real|Fractional|Integral|RealFrac|Floating|RealFloat|Monad|MonadPlus|Functor)" - - constant.string: "\"[^\\\"]*\"" - - comment: "--.*" + + # Strings + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + + # Comments + - comment: + start: "--" + end: "$" + rules: + - todo: "(TODO|XXX|FIXME):?" + - comment: start: "\\{-" end: "-\\}" - rules: [] + rules: + - todo: "(TODO|XXX|FIXME):?" - identifier.micro: "undefined"