| 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 |
- type: "'[0-9A-Za-z_]+" |
| 21 |
#constantes |
| 22 |
- constant.bool: "\\b(true|false)\\b" |
| 23 |
#modules/classes |
| 24 |
- special: "\\b(include|inherit|initializer)\\b" |
| 25 |
#expr modifiers |
| 26 |
- special: "\\b(new|ref|mutable|lazy|assert|raise)\\b" |
| 27 |
#character literal |
| 28 |
- constant.string: "'(\\\\[0-7]{3}|\\\\x[A-Fa-f0-9]{2}|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8}|\\\\[abfnrtv'\\\"\\\\]|.)'" |
| 29 |
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" |
| 30 |
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" |
| 31 |
#string literal |
| 32 |
- constant.string: |
| 33 |
start: "\"" |
| 34 |
end: "\"" |
| 35 |
skip: "\\\\." |
| 36 |
rules: |
| 37 |
- constant.specialChar: "%." |
| 38 |
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" |
| 39 |
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" |
| 40 |
- comment: |
| 41 |
start: "\\(\\*" |
| 42 |
end: "\\*\\)" |
| 43 |
rules: [] |