@@ -4,35 +4,39 @@ detect:
44 filename : " \\ .hs$"
55
66rules :
7- # Keywords
8- - statement : " \\ b(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)\\ b"
7+ - symbol.operator : " [!#$%&:*+/<=>?@.\\\\ ^\\ |~\\ p{Sm}\\ -]+"
98
10- # Various symbols
11- - symbol : " (\\ ||@|!|:|_|~|=|\\\\ |;|\\ (\\ )|,|\\ [|\\ ]|\\ {|\\ })"
9+ # Identifiers (with or without a module name)
10+ - type : " \\ b([A-Z][A-Za-z0-9_]*\\ .)*[A-Z]+[A-Za-z0-9_']*\\ b"
11+ - default : " \\ b([A-Z][A-Za-z0-9_]*\\ .)*[a-z][A-Za-z0-9_']*\\ b"
1212
13- # Operators
14- - symbol.operator : " (==|/=|&&|\\ |\\ ||<|>|<=|>=)"
13+ - statement : " ;"
14+ - symbol.bracket : " [\\ (\\ )\\ [\\ ]\\ {\\ }]"
15+ - special : " `[A-Za-z0-9']+`"
1516
16- # Various symbols
17- - special : " (->|<-)"
18- - symbol : " \\ .|\\ $"
17+ # Keywords
18+ - statement : " \\ b(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)\\ b"
1919
20- # Data constructors
20+ # Data constructors
2121 - constant.bool : " \\ b(True|False)\\ b"
2222 - constant : " \\ b(Nothing|Just|Left|Right|LT|EQ|GT)\\ b"
2323
24- # Data classes
25- - identifier.class : " \\ b(Read|Show|Enum|Eq|Ord|Data|Bounded|Typeable|Num|Real|Fractional|Integral|RealFrac|Floating|RealFloat|Monad|MonadPlus|Functor|Foldable|Additive|Zip)[ ]"
24+ - constant : " \\ (\\ )" # Unit
25+ - constant.number : " \\ b(0[xX][0-9A-Fa-f]+|0[oO][0-7]+|0[bB][01]+|[-]?[0-9]+([.][0-9]+)?([eE][+-]?[0-9]+)?)\\ b"
26+
27+ # Data classes
28+ - identifier.class : " \\ b(Additive|Applicative|Bounded|Data|Enum|Eq|Floating|Foldable|Fractional|Functor|Integral|Monad|MonadPlus|Monoid|Num|Ord|Read|Real|RealFloat|RealFrac|Semigroup|Show|Traversable|Typeable|Zip)[ ]"
2629
27- # Strings
30+ # Strings
2831 - constant.string :
2932 start : " \" "
3033 end : " \" "
3134 skip : " \\\\ ."
3235 rules :
33- - constant.specialChar : " \\\\ ."
36+ - special : " \\\\ &"
37+ - constant.specialChar : " \\\\ ([abfnrtv\" '\\\\ ]|[0-9]+|x[0-9a-fA-F]+|o[0-7]+|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL)"
3438
35- # Comments
39+ # Comments
3640 - comment :
3741 start : " --"
3842 end : " $"
4549 rules :
4650 - todo : " (TODO|XXX|FIXME):?"
4751
48- - identifier.micro : " undefined"
52+ - identifier.macro : " undefined"
0 commit comments