-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathjexl.js
23 lines (22 loc) · 778 Bytes
/
jexl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// @ts-nocheck
jexl.displayName = 'jexl'
jexl.aliases = []
/** @type {import('../core.js').Syntax} */
export default function jexl(Prism) {
Prism.languages.jexl = {
string: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
transform: {
pattern:
/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,
alias: 'function',
lookbehind: true
},
function:
/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,
number: /\b\d+(?:\.\d+)?\b|\B\.\d+\b/,
operator: /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,
boolean: /\b(?:false|true)\b/,
keyword: /\bin\b/,
punctuation: /[{}[\](),.]/
}
}