Improve IFQL syntax highlighting

pull/3499/head
Alex P 2018-05-21 16:12:11 -07:00
parent 7981ad53ee
commit 85e9eac4ac
1 changed files with 11 additions and 3 deletions

View File

@ -10,13 +10,21 @@ export const modeIFQL = {
regex: /\w+(?=[(])/, regex: /\w+(?=[(])/,
token: 'function', token: 'function',
}, },
{
regex: /[\w\d]+(?=\s[=]\s)/,
token: 'variable',
},
{ {
regex: /[=][>]/, regex: /[=][>]/,
token: 'arrow-function', token: 'arrow-function',
}, },
{
regex: /\w+(?=[)]\s[=][>])(?![(])/,
token: 'function-arg',
},
{ {
regex: /AND|OR|[=][=]|[!][=]|[<][=]|[>][=]/, regex: /AND|OR|[=][=]|[!][=]|[<][=]|[>][=]/,
token: 'logic-operator', token: 'operator',
}, },
{ {
regex: /\w+[:]/, regex: /\w+[:]/,
@ -25,11 +33,11 @@ export const modeIFQL = {
// The regex matches the token, the token property contains the type // The regex matches the token, the token property contains the type
{ {
regex: /"(?:[^\\]|\\.)*?(?:"|$)/, regex: /"(?:[^\\]|\\.)*?(?:"|$)/,
token: 'string.double', token: 'string-double',
}, },
{ {
regex: /'(?:[^\\]|\\.)*?(?:'|$)/, regex: /'(?:[^\\]|\\.)*?(?:'|$)/,
token: 'string.single', token: 'string-single',
}, },
{ {
regex: /(function)(\s+)([a-z$][\w$]*)/, regex: /(function)(\s+)([a-z$][\w$]*)/,