forked from zyedidia/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
haskell.yaml
52 lines (40 loc) · 1.7 KB
/
haskell.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
filetype: haskell
detect:
filename: "\\.hs$"
rules:
- symbol.operator: "[!#$%&:*+/<=>?@.\\\\^\\|~\\p{Sm}\\-]+"
# Identifiers (with or without a module name)
- type: "\\b([A-Z][A-Za-z0-9_]*\\.)*[A-Z]+[A-Za-z0-9_']*\\b"
- default: "\\b([A-Z][A-Za-z0-9_]*\\.)*[a-z][A-Za-z0-9_']*\\b"
- statement: ";"
- symbol.bracket: "[\\(\\)\\[\\]\\{\\}]"
- special: "`[A-Za-z0-9']+`"
# Keywords
- 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"
# Data constructors
- constant.bool: "\\b(True|False)\\b"
- constant: "\\b(Nothing|Just|Left|Right|LT|EQ|GT)\\b"
- constant: "\\(\\)" # Unit
- constant.number: "\\b(0[xX][0-9A-Fa-f]+|0[oO][0-7]+|0[bB][01]+|[-]?[0-9]+([.][0-9]+)?([eE][+-]?[0-9]+)?)\\b"
# Data classes
- 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)[ ]"
# Strings
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- special: "\\\\&"
- 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)"
# Comments
- comment:
start: "--"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "\\{-"
end: "-\\}"
rules:
- todo: "(TODO|XXX|FIXME):?"
- identifier.macro: "undefined"