1 | Prism.languages.reason = Prism.languages.extend('clike', {
|
2 | 'comment': {
|
3 | pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
|
4 | lookbehind: true
|
5 | },
|
6 | 'string': {
|
7 | pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
|
8 | greedy: true
|
9 | },
|
10 |
|
11 | 'class-name': /\b[A-Z]\w*/,
|
12 | '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/,
|
13 | 'operator': /\.{3}|:[:=]|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/
|
14 | });
|
15 | Prism.languages.insertBefore('reason', 'class-name', {
|
16 | 'character': {
|
17 | pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
|
18 | alias: 'string'
|
19 | },
|
20 | 'constructor': {
|
21 |
|
22 | pattern: /\b[A-Z]\w*\b(?!\s*\.)/,
|
23 | alias: 'variable'
|
24 | },
|
25 | 'label': {
|
26 | pattern: /\b[a-z]\w*(?=::)/,
|
27 | alias: 'symbol'
|
28 | }
|
29 | });
|
30 |
|
31 |
|
32 | delete Prism.languages.reason.function; |
\ | No newline at end of file |