UNPKG

1.69 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'];
15
16Prism.languages.insertBefore( 'jolie', 'keyword', {
17 'function':
18 {
19 pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,
20 lookbehind: true
21 },
22 'aggregates': {
23 pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
24 lookbehind: true,
25 inside: {
26 'with-extension': {
27 pattern: /\bwith\s+\w+/,
28 inside: {
29 'keyword' : /\bwith\b/
30 }
31 },
32 'function': {
33 pattern: /\w+/
34 },
35 'punctuation': {
36 pattern: /,/
37 }
38 }
39 },
40 'redirects': {
41 pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
42 lookbehind: true,
43 inside: {
44 'punctuation': {
45 pattern: /,/
46 },
47 'function': {
48 pattern: /\w+/
49 },
50 'symbol': {
51 pattern: /=>/
52 }
53 }
54 }
55});