UNPKG

1.73 kBJavaScriptView Raw
1Prism.languages.jolie = Prism.languages.extend('clike', {
2 'keyword': /\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/,
3 'builtin': /\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,
4 'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?l?/i,
5 'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,
6 'symbol': /[|;@]/,
7 'punctuation': /[,.]/,
8 'string': {
9 pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
10 greedy: true
11 }
12});
13
14delete Prism.languages.jolie['class-name'];
15delete Prism.languages.jolie['function'];
16
17Prism.languages.insertBefore( 'jolie', 'keyword', {
18 'function':
19 {
20 pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,
21 lookbehind: true
22 },
23 'aggregates': {
24 pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
25 lookbehind: true,
26 inside: {
27 'withExtension': {
28 pattern: /\bwith\s+\w+/,
29 inside: {
30 'keyword' : /\bwith\b/
31 }
32 },
33 'function': {
34 pattern: /\w+/
35 },
36 'punctuation': {
37 pattern: /,/
38 }
39 }
40 },
41 'redirects': {
42 pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
43 lookbehind: true,
44 inside: {
45 'punctuation': {
46 pattern: /,/
47 },
48 'function': {
49 pattern: /\w+/
50 },
51 'symbol': {
52 pattern: /=>/
53 }
54 }
55 }
56});
\No newline at end of file