Skip to content

Commit

Permalink
Qore: Regexp simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Oct 22, 2017
1 parent f09f9f5 commit 69459f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-qore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Prism.languages.qore = Prism.languages.extend('clike', {
},
// Overridden to allow unescaped multi-line strings
'string': {
pattern: /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\])*\1/,
pattern: /("|')(\\[\s\S]|(?!\1)[^\\])*\1/,
greedy: true
},
'variable': /\$(?!\d)\w+\b/,
'keyword': /\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:int|float|number|bool|string|date|list)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,
'number': /\b(?:0b[01]+|0x[\da-f]*\.?[\da-fp\-]+|\d*\.?\d+e?\d*[df]|\d*\.?\d+)\b/i,
'boolean': /\b(?:true|false)\b/i,
'operator': {
pattern: /(^|[^\.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,
lookbehind: true
},
'function': /\$?\b(?!\d)\w+(?=\()/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-qore.min.js

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

0 comments on commit 69459f0

Please sign in to comment.