complier/vs-extension/syntaxes/xlang.tmLanguage.json

96 lines
1.5 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "xlang",
"patterns": [
{
"include": "#comments"
},
{
"include": "#operators"
},
{
"include": "#brackets"
},
{
"include": "#variables"
},
{
"include": "#keywords"
},
{
"include": "#strings"
}
],
"repository": {
"keywords": {
"patterns": [{
"name": "keyword.control",
"match": "\\b(if|else|return|var|exit)\\b"
}]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape",
"match": "\\\\."
}
]
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator",
"match": "[+*/-]|\\*|/"
}
]
},
"brackets": {
"patterns": [
{
"name": "punctuation.bracket",
"match": "[\\(\\)\\[\\]\\{\\}]"
}
]
},
"variables": {
"patterns": [
{
"match": "\\bvar\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"0": {
"name": "keyword.control"
},
"1": {
"name": "variable.other"
}
}
},
{
"name": "variable.other",
"match": "\\b(?!if|else|return|var|exit\\b)[a-zA-Z_][a-zA-Z0-9_]*\\b"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.double-slash",
"match": "//.*$"
},
{
"name": "comment.block",
"begin": "/\\*",
"end": "\\*/"
}
]
}
},
"scopeName": "source.x"
}