Skip to content

Commit

Permalink
Jolie: Regexp optimisation + don't use captures if not needed + remov…
Browse files Browse the repository at this point in the history
…e duplicates in keywords
  • Loading branch information
Golmote committed Oct 22, 2017
1 parent 93d4002 commit a491f9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions components/prism-jolie.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Prism.languages.jolie = Prism.languages.extend('clike', {
'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|extender|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/g,
'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/,
'builtin': /\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,
'number': /\b\d*\.?\d+(?:e[+-]?\d+)?l?\b/i,
'operator': /->|<<|[!+-<>=*]?=|[:<>!?*\/%^]|&&|\|\||--?|\+\+?/g,
'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,
'symbol': /[|;@]/,
'punctuation': /[,.]/,
'string': {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
}
});

delete Prism.languages.jolie['class-name'];
Expand Down Expand Up @@ -46,10 +46,10 @@ Prism.languages.insertBefore( 'jolie', 'keyword', {
pattern: /,/
},
'function': {
pattern: /\w+/g
pattern: /\w+/
},
'symbol': {
pattern: /=>/g
pattern: /=>/
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/prism-jolie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a491f9e

Please sign in to comment.