feat(cdl): allow INVALID in CATEGORY pattern

Accept "INVALID" as a valid token in the CATEGORY grammar rule (both the initial
and repeated entries). Also compacted several JSON objects (pattern includes
and "captures" entries) in syntaxes/cdl.tmLanguage.json; these formatting
changes are non-functional.
This commit is contained in:
Christoph Brandau
2026-09-21 20:52:53 +02:00
parent 547da644ce
commit 84821d2852
+14 -52
View File
@@ -2,27 +2,13 @@
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "CDL Support",
"patterns": [
{
"include": "#comment"
},
{
"include": "#function"
},
{
"include": "#variables"
},
{
"include": "#types"
},
{
"include": "#keywords"
},
{
"include": "#numbers"
},
{
"include": "#strings"
}
{ "include": "#comment" },
{ "include": "#function" },
{ "include": "#variables" },
{ "include": "#types" },
{ "include": "#keywords" },
{ "include": "#numbers" },
{ "include": "#strings" }
],
"repository": {
"keywords": {
@@ -70,11 +56,7 @@
{
"name": "keyword.control.cdl",
"match": "TYPE\\s+(o|g|i|d|b|s)\\b",
"captures": {
"1": {
"name": "storage.type.cs"
}
}
"captures": { "1": { "name": "storage.type.cs" } }
}
]
},
@@ -83,38 +65,22 @@
{
"name": "keyword.control.cdl",
"match": "\\b(PARAM|EVENT)\\s+([a-zA-Z_]\\w*)\\b",
"captures": {
"2": {
"name": "variable.other.cdl"
}
}
"captures": { "2": { "name": "variable.other.cdl" } }
},
{
"name": "keyword.control.cdl",
"match": "\\bMACHINE\\s+([a-zA-Z_]\\w*)\\b",
"captures": {
"1": {
"name": "variable.other.cdl"
}
}
"captures": { "1": { "name": "variable.other.cdl" } }
},
{
"name": "keyword.control.cdl",
"match": "\\bCATEGORY\\s+((MILL|LATHE|DRILL)(\\s+(MILL|LATHE|DRILL))*)\\b",
"captures": {
"1": {
"name": "variable.language.cdl"
}
}
"match": "\\bCATEGORY\\s+((MILL|LATHE|DRILL|INVALID)(\\s+(MILL|LATHE|DRILL|INVALID))*)\\b",
"captures": { "1": { "name": "variable.language.cdl" } }
},
{
"name": "keyword.control.cdl",
"match": "\\bTOGGLE\\s+(OFF|ON|off|on)\\b",
"captures": {
"1": {
"name": "variable.other.constant"
}
}
"captures": { "1": { "name": "variable.other.constant" } }
}
]
},
@@ -123,11 +89,7 @@
{
"name": "storage.type.function.cdl",
"match": "\\bEVENT\\s+([a-zA-Z_]\\w*)\\b",
"captures": {
"1": {
"name": "entity.name.function"
}
}
"captures": { "1": { "name": "entity.name.function" } }
}
]
},