1 | Prism.languages.clike = {
|
2 | 'comment': [
|
3 | {
|
4 | pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
5 | lookbehind: true,
|
6 | greedy: true
|
7 | },
|
8 | {
|
9 | pattern: /(^|[^\\:])\/\/.*/,
|
10 | lookbehind: true,
|
11 | greedy: true
|
12 | }
|
13 | ],
|
14 | 'string': {
|
15 | pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
16 | greedy: true
|
17 | },
|
18 | 'class-name': {
|
19 | pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
|
20 | lookbehind: true,
|
21 | inside: {
|
22 | 'punctuation': /[.\\]/
|
23 | }
|
24 | },
|
25 | 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
|
26 | 'boolean': /\b(?:true|false)\b/,
|
27 | 'function': /\w+(?=\()/,
|
28 | 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
29 | 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
30 | 'punctuation': /[{}[\];(),.:]/
|
31 | };
|