Improved syntax, added full word select

This commit is contained in:
2025-07-31 17:42:00 -06:00
parent 889c150b08
commit b362770d90
4 changed files with 264 additions and 343 deletions

View File

@@ -12,6 +12,10 @@
"name": "string.regexp",
"match": "\\b[\\w\\.]+:"
},
{
"name": "meta",
"match": "\\s:"
},
{
"include": "#function-decl"
},
@@ -42,6 +46,12 @@
{
"include": "#if-statement-end"
},
{
"include": "#else"
},
{
"include": "#then"
},
{
"include": "#for-statement"
},
@@ -407,7 +417,7 @@
},
"logical-operator": {
"name": "keyword.operator.logical",
"match": "(?i)\\b(NOT|AND|OR|XOR)\\b"
"match": "(?i)\\b(NOT|AND|OR|XOR)($|\\n|\\s\\()"
},
"string-operator": {
"name": "keyword.operator",
@@ -513,7 +523,7 @@
},
{
"name": "support.function",
"match": "(?i)\\b(NULL|TRUE|FALSE|READ|WRITE|KEY)\\b[^%\\$\\.]"
"match": "(?i)\\b(NULL|TRUE|FALSE|READ|WRITE|KEY|NOWRITE|NODEL)\\b[^%\\$\\.]"
}
]
},
@@ -633,127 +643,20 @@
}
},
"if-statement": {
"name": "meta.if",
"begin": "(?i)\\b(IF)",
"beginCaptures": {
"0": {
"name": "keyword.control"
}
},
"patterns": [
{
"include": "#math-function"
},
{
"include": "#string-function"
},
{
"include": "#number-literal"
},
{
"include": "#arithmetic-operator"
},
{
"include": "#relational-operator"
},
{
"include": "#logical-operator"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"name": "keyword.control",
"match": "(?i)THEN"
},
{
"name": "keyword.control",
"match": "(?i)ELSE"
},
{
"name": "keyword.control",
"match": "(?i)(BEGIN)"
},
{
"include": "#identifier"
},
{
"include": "#line-continuation"
},
{
"include": "#comments"
},
{
"match": "\\s+",
"name": "text.whitespace"
}
],
"end": "(?<!\\\\)(\\n)"
"name": "keyword.control",
"match": "(?i)\\b(IF|BEGIN)\\b"
},
"if-statement-end": {
"name": "meta.if.end",
"begin": "(?i)ENDIF",
"beginCaptures": {
"0": {
"name": "keyword.control"
}
},
"patterns": [
{
"name": "keyword.control",
"match": "ELSE"
},
{
"include": "#math-function"
},
{
"include": "#string-function"
},
{
"include": "#number-literal"
},
{
"include": "#arithmetic-operator"
},
{
"include": "#relational-operator"
},
{
"include": "#logical-operator"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"name": "keyword.control",
"match": "THEN|then"
},
{
"name": "keyword.control",
"match": "(?i)BEGIN"
},
{
"name": "keyword.control",
"match": "(?i)ELSE"
},
{
"name": "keyword.control",
"match": "(?i)IF"
},
{
"include": "#line-continuation"
},
{
"include": "#comments"
}
],
"end": "(?<!\\\\)\\n"
"name": "keyword.control",
"match": "(?i)ENDIF"
},
"else": {
"name": "keyword.control",
"match": "(?i)ELSE"
},
"then": {
"name": "keyword.control",
"match": "(?i)THEN"
},
"for-statement": {
"name": "meta.for",