1 | Prism.languages.reason = Prism.languages.extend('clike', {
|
2 | 'string': {
|
3 | pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
|
4 | greedy: true
|
5 | },
|
6 |
|
7 | 'class-name': /\b[A-Z]\w*/,
|
8 | 'keyword': /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,
|
9 | 'operator': /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/
|
10 | });
|
11 | Prism.languages.insertBefore('reason', 'class-name', {
|
12 | 'character': {
|
13 | pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
|
14 | alias: 'string'
|
15 | },
|
16 | 'constructor': {
|
17 |
|
18 | pattern: /\b[A-Z]\w*\b(?!\s*\.)/,
|
19 | alias: 'variable'
|
20 | },
|
21 | 'label': {
|
22 | pattern: /\b[a-z]\w*(?=::)/,
|
23 | alias: 'symbol'
|
24 | }
|
25 | });
|
26 |
|
27 |
|
28 | delete Prism.languages.reason.function;
|