From 84821d28525e2de23ae3d6ba1628e5adb7f5da8a Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Mon, 21 Sep 2026 20:52:53 +0200 Subject: [PATCH] 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. --- syntaxes/cdl.tmLanguage.json | 66 ++++++++---------------------------- 1 file changed, 14 insertions(+), 52 deletions(-) diff --git a/syntaxes/cdl.tmLanguage.json b/syntaxes/cdl.tmLanguage.json index d2052f6..7cd2f44 100644 --- a/syntaxes/cdl.tmLanguage.json +++ b/syntaxes/cdl.tmLanguage.json @@ -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" } } } ] },