1 | (function (Prism) {
|
2 | Prism.languages.dataweave = {
|
3 | 'url': /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
|
4 | 'property': {
|
5 | pattern: /(?:\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\w+)(?=\s*[:@])/,
|
6 | greedy: true
|
7 | },
|
8 | 'string': {
|
9 | pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
|
10 | greedy: true
|
11 | },
|
12 | 'mime-type': /\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,
|
13 | 'date': {
|
14 | pattern: /\|[\w:+-]+\|/,
|
15 | greedy: true
|
16 | },
|
17 | 'comment': [
|
18 | {
|
19 | pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
20 | lookbehind: true,
|
21 | greedy: true
|
22 | },
|
23 | {
|
24 | pattern: /(^|[^\\:])\/\/.*/,
|
25 | lookbehind: true,
|
26 | greedy: true
|
27 | }
|
28 | ],
|
29 | 'regex': {
|
30 | pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
|
31 | greedy: true
|
32 | },
|
33 | 'function': /\b[A-Za-z_]\w*(?=\s*\()/i,
|
34 | 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
35 | 'punctuation': /[{}[\];(),.:@]/,
|
36 | 'operator': /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|\!|\?/,
|
37 | 'boolean': /\b(?:true|false)\b/,
|
38 | 'keyword': /\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/
|
39 | };
|
40 |
|
41 | }(Prism));
|