OLD | NEW |
(Empty) | |
| 1 Prism.languages.ocaml = { |
| 2 'comment': /\(\*[\s\S]*?\*\)/, |
| 3 'string': [ |
| 4 /"(?:\\.|[^\\\r\n"])*"/, |
| 5 /(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i |
| 6 ], |
| 7 'number': /\b-?(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]
?[\d_]+)?)/i, |
| 8 'type': { |
| 9 pattern: /\B['`][a-z\d_]*/i, |
| 10 alias: 'variable' |
| 11 }, |
| 12 'directive': { |
| 13 pattern: /\B#[a-z\d_]+/i, |
| 14 alias: 'function' |
| 15 }, |
| 16 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|en
d|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|
lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|
sig|struct|to|try|type|val|value|virtual|where|while|with)\b/, |
| 17 'boolean': /\b(?:false|true)\b/, |
| 18 // Custom operators are allowed |
| 19 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&\*+\-.\/:<=>?@^|~]*|\b(?:and|as
r|land|lor|lxor|lsl|lsr|mod|nor|or)\b/, |
| 20 'punctuation': /[(){}\[\]|_.,:;]/ |
| 21 }; |
OLD | NEW |