From a5b8d2a54d1d76fbac81f92dbb67eafbe164ad1a Mon Sep 17 00:00:00 2001 From: Damian Tarnawski Date: Wed, 4 Oct 2023 21:57:51 +0200 Subject: Minor grammar updates - Remove `export` and `set` as keywords - Add `or_break` and `or_continue` as keywords - Add `&` and `^` as operators - Add string beginning and ending quotes as punctuation --- editors/vscode/syntaxes/odin.tmLanguage.json | 49 +++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/editors/vscode/syntaxes/odin.tmLanguage.json b/editors/vscode/syntaxes/odin.tmLanguage.json index a2f7f33..289dd7b 100644 --- a/editors/vscode/syntaxes/odin.tmLanguage.json +++ b/editors/vscode/syntaxes/odin.tmLanguage.json @@ -309,7 +309,7 @@ }, { "name": "keyword.control.odin", - "match": "\\b(import|export|foreign|package)\\b" + "match": "\\b(import|foreign|package)\\b" }, { "name": "keyword.control.odin", @@ -317,7 +317,7 @@ }, { "name": "keyword.control.odin", - "match": "\\b(fallthrough|break|continue|case|dynamic)\\b" + "match": "\\b(fallthrough|break|or_break|continue|or_continue|case|dynamic)\\b" }, { "name": "keyword.control.odin", @@ -353,7 +353,7 @@ }, { "name": "storage.type.odin", - "match": "\\b(struct|enum|union|map|set|bit_set|typeid|matrix)\\b" + "match": "\\b(struct|enum|union|map|bit_set|typeid|matrix)\\b" }, { "name": "keyword.function.odin", @@ -379,6 +379,14 @@ "name": "keyword.operator.assignment.odin", "match": ":[:=]|=" }, + { + "name": "keyword.operator.address.odin", + "match": "\\&" + }, + { + "name": "keyword.operator.pointer.odin", + "match": "\\^" + }, { "match": "->", "name": "storage.type.function.arrow.odin" @@ -460,18 +468,49 @@ { "name": "string.quoted.double.odin", "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.odin" + } + }, "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.odin" + } + }, "patterns": [{ "include": "#string-escaped-char" }] }, { - "name": "string.quoted.double.odin", + "name": "string.quoted.raw.odin", "begin": "`", - "end": "`" + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.odin" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.odin" + } + }, + "patterns": [{ "include": "#string-escaped-char" }] }, { "name": "string.quoted.single.odin", "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.odin" + } + }, "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.odin" + } + }, "patterns": [{ "include": "#string-escaped-char" }] } ] -- cgit v1.2.3