]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/ocaml.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / ocaml.yaml
1 filetype: ocaml
2
3 detect:
4     filename: "\\.mli?$"
5
6 rules:
7     - identifier: "\\b[A-Z][0-9a-z_]{2,}\\b"
8       #declarations
9     - statement: "\\b(let|val|method|in|and|rec|private|virtual|constraint)\\b"
10       #structure items
11     - type: "\\b(type|open|class|module|exception|external)\\b"
12       #patterns
13     - statement: "\\b(fun|function|functor|match|try|with)\\b"
14       #patterns-modifiers
15     - statement: "\\b(as|when|of)\\b" 
16       #conditions
17     - statement: "\\b(if|then|else)\\b"
18       #blocs
19     - type: "\\b(begin|end|object|struct|sig|for|while|do|done|to|downto)\\b"
20       #constantes
21     - constant.bool: "\\b(true|false)\\b"
22       #modules/classes
23     - special: "\\b(include|inherit|initializer)\\b"
24       #expr modifiers
25     - special: "\\b(new|ref|mutable|lazy|assert|raise)\\b"
26     - constant.string:
27         start: "'"
28         end: "'"
29         skip: "\\\\."
30         rules:
31             - constant.specialChar: "%."
32             - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
33             - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
34     - constant.string:
35         start: "\""
36         end: "\""
37         skip: "\\\\."
38         rules:
39             - constant.specialChar: "%."
40             - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
41             - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
42     - comment:
43         start: "\\(\\*"
44         end: "\\*\\)"
45         rules: []