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.8 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = cfscript
|
---|
| 4 | cfscript.displayName = 'cfscript'
|
---|
| 5 | cfscript.aliases = []
|
---|
| 6 | function cfscript(Prism) {
|
---|
| 7 | // https://cfdocs.org/script
|
---|
| 8 | Prism.languages.cfscript = Prism.languages.extend('clike', {
|
---|
| 9 | comment: [
|
---|
| 10 | {
|
---|
| 11 | pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
---|
| 12 | lookbehind: true,
|
---|
| 13 | inside: {
|
---|
| 14 | annotation: {
|
---|
| 15 | pattern: /(?:^|[^.])@[\w\.]+/,
|
---|
| 16 | alias: 'punctuation'
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
| 19 | },
|
---|
| 20 | {
|
---|
| 21 | pattern: /(^|[^\\:])\/\/.*/,
|
---|
| 22 | lookbehind: true,
|
---|
| 23 | greedy: true
|
---|
| 24 | }
|
---|
| 25 | ],
|
---|
| 26 | keyword:
|
---|
| 27 | /\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*=)/,
|
---|
| 28 | operator: [
|
---|
| 29 | /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
|
---|
| 30 | /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
|
---|
| 31 | ],
|
---|
| 32 | scope: {
|
---|
| 33 | pattern:
|
---|
| 34 | /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
|
---|
| 35 | alias: 'global'
|
---|
| 36 | },
|
---|
| 37 | type: {
|
---|
| 38 | pattern:
|
---|
| 39 | /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
|
---|
| 40 | alias: 'builtin'
|
---|
| 41 | }
|
---|
| 42 | })
|
---|
| 43 | Prism.languages.insertBefore('cfscript', 'keyword', {
|
---|
| 44 | // This must be declared before keyword because we use "function" inside the lookahead
|
---|
| 45 | 'function-variable': {
|
---|
| 46 | pattern:
|
---|
| 47 | /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
---|
| 48 | alias: 'function'
|
---|
| 49 | }
|
---|
| 50 | })
|
---|
| 51 | delete Prism.languages.cfscript['class-name']
|
---|
| 52 | Prism.languages.cfc = Prism.languages['cfscript']
|
---|
| 53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.