Skip to content

Commit

Permalink
Simplify patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
mjclemente committed Feb 19, 2021
1 parent 9ae65c7 commit 8ae1025
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions components/prism-cfscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,19 @@ Prism.languages.cfscript = Prism.languages.extend('clike', {
greedy: true
}
],
'keyword': [
{
pattern: /\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*\=)/
}
],
'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*\=)/,
'operator': [
{
pattern: /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/
},
{
pattern: /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
}
/\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
],
'scope': [
{
pattern: /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
alias: ['global']
}
],
'type': [
{
pattern: /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
alias: 'builtin'
}
]
'scope': {
pattern: /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
alias: 'global'
},
'type': {
pattern: /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
alias: 'builtin'
}
});

Prism.languages.insertBefore('cfscript', 'keyword', {
Expand Down

0 comments on commit 8ae1025

Please sign in to comment.