diff --git a/editor-extensions/vscode/syntaxes/grain.json b/editor-extensions/vscode/syntaxes/grain.json index 393ca72..74f609c 100644 --- a/editor-extensions/vscode/syntaxes/grain.json +++ b/editor-extensions/vscode/syntaxes/grain.json @@ -681,7 +681,7 @@ "name": "punctuation.support.grain" }, { - "match": "\\b(type)\\b\\s*([A-Z]\\w*)\\b", + "match": "\\b(type|exception)\\b\\s*([A-Z]\\w*)\\b", "captures": { "1": { "patterns": [{ "include": "#keywords" }] }, "2": { "patterns": [{ "include": "#type" }] } @@ -694,12 +694,7 @@ "match": "\\b[A-Z]\\w*\\b", "name": "entity.name.module.grain" }, - { - "match": "(\\b\\w+\\b)", - "captures": { - "1": { "patterns": [{ "include": "#identifier" }] } - } - } + { "include": "#identifier" } ] }, { @@ -733,7 +728,7 @@ } ] }, - "identifier": { + "operator": { "patterns": [ { "match": "(==|!=|<|>|\\^|\\+|-|\\*|%|/|&|\\||\\?\\?)[$&\\*/\\+\\-=><\\^\\|\\!\\?%:\\.]*", @@ -747,6 +742,24 @@ "match": "\\bis(nt)?\\b", "name": "keyword.operator.grain" }, + { + "begin": "(\\()", + "end": "(\\))", + "beginCaptures": { + "1": { "name": "punctuation.definition.parameters.begin.grain" } + }, + "endCaptures": { + "1": { "name": "punctuation.definition.parameters.end.grain" } + }, + "patterns": [{ "include": "#operator" }] + } + ] + }, + "identifier": { + "patterns": [ + { + "include": "#operator" + }, { "match": "(\\.\\.\\.|\\.)", "name": "keyword.operator.grain"