diff options
Diffstat (limited to 'public/prism/prism-clike.js')
| -rw-r--r-- | public/prism/prism-clike.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/public/prism/prism-clike.js b/public/prism/prism-clike.js new file mode 100644 index 0000000..e1f4acd --- /dev/null +++ b/public/prism/prism-clike.js @@ -0,0 +1,33 @@ +Prism.languages.clike = { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + 'class-name': { + pattern: + /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { + punctuation: /[.\\]/, + }, + }, + keyword: + /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, + boolean: /\b(?:false|true)\b/, + function: /\b\w+(?=\()/, + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + punctuation: /[{}[\];(),.:]/, +}; |
