File: haskell.yaml

package info (click to toggle)
micro 2.0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,828 kB
  • sloc: sh: 247; makefile: 77; xml: 53
file content (52 lines) | stat: -rw-r--r-- 1,744 bytes parent folder | download | duplicates (2)
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"