main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | // https://cfdocs.org/script
|
---|
| 2 | Prism.languages.cfscript = Prism.languages.extend('clike', {
|
---|
| 3 | 'comment': [
|
---|
| 4 | {
|
---|
| 5 | pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
---|
| 6 | lookbehind: true,
|
---|
| 7 | inside: {
|
---|
| 8 | 'annotation': {
|
---|
| 9 | pattern: /(?:^|[^.])@[\w\.]+/,
|
---|
| 10 | alias: 'punctuation'
|
---|
| 11 | }
|
---|
| 12 | }
|
---|
| 13 | },
|
---|
| 14 | {
|
---|
| 15 | pattern: /(^|[^\\:])\/\/.*/,
|
---|
| 16 | lookbehind: true,
|
---|
| 17 | greedy: true
|
---|
| 18 | }
|
---|
| 19 | ],
|
---|
| 20 | 'keyword': /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
|
---|
| 21 | 'operator': [
|
---|
| 22 | /\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/,
|
---|
| 23 | /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
|
---|
| 24 | ],
|
---|
| 25 | 'scope': {
|
---|
| 26 | pattern: /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
|
---|
| 27 | alias: 'global'
|
---|
| 28 | },
|
---|
| 29 | 'type': {
|
---|
| 30 | pattern: /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
|
---|
| 31 | alias: 'builtin'
|
---|
| 32 | }
|
---|
| 33 | });
|
---|
| 34 |
|
---|
| 35 | Prism.languages.insertBefore('cfscript', 'keyword', {
|
---|
| 36 | // This must be declared before keyword because we use "function" inside the lookahead
|
---|
| 37 | 'function-variable': {
|
---|
| 38 | pattern: /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
---|
| 39 | alias: 'function'
|
---|
| 40 | }
|
---|
| 41 | });
|
---|
| 42 |
|
---|
| 43 | delete Prism.languages.cfscript['class-name'];
|
---|
| 44 | Prism.languages.cfc = Prism.languages['cfscript'];
|
---|
Note:
See
TracBrowser
for help on using the repository browser.