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