1 |
|
2 |
|
3 |
|
4 | Prism.languages['avro-idl'] = {
|
5 | 'comment': {
|
6 | pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
|
7 | greedy: true
|
8 | },
|
9 | 'string': [
|
10 | {
|
11 | pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
|
12 | lookbehind: true,
|
13 | greedy: true
|
14 | },
|
15 | {
|
16 | pattern: /(^|[^\\])'(?:[^\r\n'\\]|\\(?:[\s\S]|\d{1,3}))'/,
|
17 | lookbehind: true,
|
18 | greedy: true
|
19 | }
|
20 | ],
|
21 |
|
22 | 'annotation': {
|
23 | pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
|
24 | greedy: true,
|
25 | alias: 'function'
|
26 | },
|
27 | 'function-identifier': {
|
28 | pattern: /`[^\r\n`]+`(?=\s*\()/,
|
29 | greedy: true,
|
30 | alias: 'function'
|
31 | },
|
32 | 'identifier': {
|
33 | pattern: /`[^\r\n`]+`/,
|
34 | greedy: true
|
35 | },
|
36 |
|
37 | 'class-name': {
|
38 | pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
|
39 | lookbehind: true,
|
40 | greedy: true
|
41 | },
|
42 | 'keyword': /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
|
43 | 'function': /\b[a-z_]\w*(?=\s*\()/i,
|
44 |
|
45 | 'number': [
|
46 | {
|
47 | pattern: /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
|
48 | lookbehind: true
|
49 | },
|
50 | /-?\b(?:NaN|Infinity)\b/
|
51 | ],
|
52 |
|
53 | 'operator': /=/,
|
54 | 'punctuation': /[()\[\]{}<>.:,;-]/
|
55 | };
|
56 |
|
57 | Prism.languages.avdl = Prism.languages['avro-idl'];
|