openquest-vscode/syntaxes/quest.tmLanguage.json

59 lines
1.6 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Quest",
"scopeName": "source.quest",
"patterns": [
{"include": "#define_substitution"},
{"include": "#quest_clause"}
],
"repository": {
"define_substitution": {
"name": "keyword.control.quest",
"match": "\\b(define)\\s(.+)\\s(.+)\\b",
"captures": {
"1": {"name": "keyword.function"},
"2": {"name": "entity.other.attribute-name"},
"3": {"name": "variable.other"}
}
},
"quest_clause": {
"begin": "\\b(quest)\\s(.+)\\s(with)\\s(.+)\\s(begin)",
"beginCaptures": {
"1": {"name": "keyword"},
"2": {"name": "entity.other.attribute-name"},
"3": {"name": "keyword"},
"4": {"name": "variable.other"},
"5": {"name": "punctuation.paren.open"}
},
"end": "end", "endCaptures": {"0": {"name": "punctuation.paren.close"}},
"patterns": [{"include": "#state_clause"}]
},
"state_clause": {
"begin": "(state)\\s(.+)\\s(begin)",
"beginCaptures": {
"1": {"name": "keyword"},
"2": {"name": "entity.other.attribute-name"},
"3": {"name": "punctuation.paren.open"}
},
"end": "end", "endCaptures": {"0": {"name": "punctuation.paren.close"}},
"patterns": [{"include": "#with_clause"}]
},
"with_clause": {
"name": "keyword.control.with_clause",
"begin": "when\\s(.+)\\sbegin",
"beginCaptures": {
"0": {"name": "punctuation.paren.open"},
"1": {"name": "storage.modifier.quest"}
},
"end": "end", "endCaptures": {"0": {"name": "punctuation.paren.close"}}
},
"lua_scope": {
}
}
}