[d24f17c] | 1 | Prism.languages.concurnas = {
|
---|
| 2 | 'comment': {
|
---|
| 3 | pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
|
---|
| 4 | lookbehind: true,
|
---|
| 5 | greedy: true
|
---|
| 6 | },
|
---|
| 7 | 'langext': {
|
---|
| 8 | pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
|
---|
| 9 | greedy: true,
|
---|
| 10 | inside: {
|
---|
| 11 | 'class-name': /^\w+/,
|
---|
| 12 | 'string': {
|
---|
| 13 | pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
|
---|
| 14 | lookbehind: true
|
---|
| 15 | },
|
---|
| 16 | 'punctuation': /\|\|/
|
---|
| 17 | }
|
---|
| 18 | },
|
---|
| 19 | 'function': {
|
---|
| 20 | pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
|
---|
| 21 | lookbehind: true
|
---|
| 22 | },
|
---|
| 23 | 'keyword': /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
|
---|
| 24 | 'boolean': /\b(?:false|true)\b/,
|
---|
| 25 | 'number': /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
|
---|
| 26 | 'punctuation': /[{}[\];(),.:]/,
|
---|
| 27 | 'operator': /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
|
---|
| 28 | 'annotation': {
|
---|
| 29 | pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
|
---|
| 30 | alias: 'builtin'
|
---|
| 31 | }
|
---|
| 32 | };
|
---|
| 33 |
|
---|
| 34 | Prism.languages.insertBefore('concurnas', 'langext', {
|
---|
| 35 | 'regex-literal': {
|
---|
| 36 | pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
---|
| 37 | greedy: true,
|
---|
| 38 | inside: {
|
---|
| 39 | 'interpolation': {
|
---|
| 40 | pattern: /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
---|
| 41 | lookbehind: true,
|
---|
| 42 | inside: Prism.languages.concurnas
|
---|
| 43 | },
|
---|
| 44 | 'regex': /[\s\S]+/
|
---|
| 45 | }
|
---|
| 46 | },
|
---|
| 47 | 'string-literal': {
|
---|
| 48 | pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
---|
| 49 | greedy: true,
|
---|
| 50 | inside: {
|
---|
| 51 | 'interpolation': {
|
---|
| 52 | pattern: /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
---|
| 53 | lookbehind: true,
|
---|
| 54 | inside: Prism.languages.concurnas
|
---|
| 55 | },
|
---|
| 56 | 'string': /[\s\S]+/
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 | });
|
---|
| 60 |
|
---|
| 61 | Prism.languages.conc = Prism.languages.concurnas;
|
---|