144 lines
2.5 KiB
JSON
144 lines
2.5 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)(\\s+(MILL|LATHE|DRILL))*)\\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"
|
|
} |