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.
106 lines
2.3 KiB
JSON
106 lines
2.3 KiB
JSON
{
|
|
"$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" }
|
|
],
|
|
"repository": {
|
|
"keywords": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.cdl",
|
|
"match": "\\b(UI_LABEL|PARAM|EVENT|POST_EVENT|DEFVAL|CATEGORY|TYPE|OPTIONS|UI_HELP|MACHINE|TOGGLE)\\b"
|
|
}
|
|
]
|
|
},
|
|
"strings": {
|
|
"name": "string.quoted.double.cdl",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.cdl",
|
|
"match": "\\\\."
|
|
}
|
|
]
|
|
},
|
|
"numbers": {
|
|
"name": "constant.numeric",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.numeric",
|
|
"match": "\"\\d+\""
|
|
},
|
|
{
|
|
"name": "constant.numeric",
|
|
"match": "\"\\d+.\\d+\""
|
|
},
|
|
{
|
|
"name": "constant.numeric",
|
|
"match": "\\d+"
|
|
},
|
|
{
|
|
"name": "constant.numeric",
|
|
"match": "\\d+.\\d+"
|
|
}
|
|
]
|
|
},
|
|
"types": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.cdl",
|
|
"match": "TYPE\\s+(o|g|i|d|b|s)\\b",
|
|
"captures": { "1": { "name": "storage.type.cs" } }
|
|
}
|
|
]
|
|
},
|
|
"variables": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.cdl",
|
|
"match": "\\b(PARAM|EVENT)\\s+([a-zA-Z_]\\w*)\\b",
|
|
"captures": { "2": { "name": "variable.other.cdl" } }
|
|
},
|
|
{
|
|
"name": "keyword.control.cdl",
|
|
"match": "\\bMACHINE\\s+([a-zA-Z_]\\w*)\\b",
|
|
"captures": { "1": { "name": "variable.other.cdl" } }
|
|
},
|
|
{
|
|
"name": "keyword.control.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" } }
|
|
}
|
|
]
|
|
},
|
|
"function": {
|
|
"patterns": [
|
|
{
|
|
"name": "storage.type.function.cdl",
|
|
"match": "\\bEVENT\\s+([a-zA-Z_]\\w*)\\b",
|
|
"captures": { "1": { "name": "entity.name.function" } }
|
|
}
|
|
]
|
|
},
|
|
"comment": {
|
|
"patterns": [
|
|
{
|
|
"name": "comment.line.cdl",
|
|
"match": "#.*"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"scopeName": "source.cdl"
|
|
} |