aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-06-28 08:35:18 +0200
committerGitHub <noreply@github.com>2024-06-28 08:35:18 +0200
commit670c350550d3f9d41b864be593fc3f43a43f99fa (patch)
tree63a6a1f18f15788b54dec3b4d378f15775245223
parent974d9b236eea5cecf681d5d261915d6b1e9d2e21 (diff)
parent3870fa27c603e66dc24c33bd3693fb8b30b19f01 (diff)
Merge pull request #412 from thetarnav/tm-improvents-comments
Minor improvements to tm grammars
-rw-r--r--editors/vscode/syntaxes/odin.tmLanguage.json113
1 files changed, 50 insertions, 63 deletions
diff --git a/editors/vscode/syntaxes/odin.tmLanguage.json b/editors/vscode/syntaxes/odin.tmLanguage.json
index 8417504..6f44764 100644
--- a/editors/vscode/syntaxes/odin.tmLanguage.json
+++ b/editors/vscode/syntaxes/odin.tmLanguage.json
@@ -359,27 +359,22 @@
{
"name": "comment.line.double-slash.odin",
"begin": "//",
+ "beginCaptures": {"0": {"name": "punctuation.definition.comment.odin"}},
"end": "\n"
}
]
},
"block-comment": {
- "patterns": [
- {
- "name": "comment.block.odin",
- "begin": "/\\*",
- "end": "\\*/",
- "patterns": [ { "include": "#block-comment" } ]
- }
- ]
+ "name": "comment.block.odin",
+ "begin": "/\\*",
+ "beginCaptures": {"0": {"name": "punctuation.definition.comment.begin.odin"}},
+ "end": "\\*/",
+ "endCaptures": {"0": {"name": "punctuation.definition.comment.end.odin"}},
+ "patterns": [ { "include": "#block-comment" } ]
},
"type-name": {
- "patterns": [
- {
- "name": "entity.name.type.odin",
- "match": "\\b[A-Za-z_]\\w*\\b"
- }
- ]
+ "name": "entity.name.type.odin",
+ "match": "\\b[A-Za-z_]\\w*\\b"
},
"type-parameter": {
"captures": {
@@ -389,21 +384,12 @@
"match": "(\\$)\\s*(\\b[A-Za-z_]\\w*\\b)"
},
"variable-name": {
- "patterns": [
- {
- "name": "variable.name.odin",
- "match": "\\b[A-Za-z_]\\w*\\b"
- }
- ]
+ "name": "variable.name.odin",
+ "match": "\\b[A-Za-z_]\\w*\\b"
},
"keywords": {
"patterns": [
{
- "name": "keyword.tag.odin",
- "comment": "Use #name to use a pattern",
- "match": "\\b([#@]\\s*[A-Za-z_]\\w*)\\b"
- },
- {
"name": "keyword.control.odin",
"match": "\\b(import|foreign|package)\\b"
},
@@ -463,28 +449,36 @@
"match": "\\b(struct|enum|union|map|bit_set|bit_field|matrix)\\b"
},
{
- "name": "keyword.operator.assignment.compound",
+ "name": "keyword.operator.assignment.compound.odin",
"match": "[+\\-*/%]=|%%="
},
{
- "name": "keyword.operator.assignment.compound.bitwise",
+ "name": "keyword.operator.assignment.compound.bitwise.odin",
"match": "\\|=|~=|&~?=|<<=|>>="
},
{
- "name": "keyword.operator.comparison",
+ "name": "keyword.operator.comparison.odin",
"match": "==|!="
},
{
- "name": "keyword.operator.relational",
+ "name": "keyword.operator.relational.odin",
"match": "[<>]=?"
},
{
+ "name": "keyword.operator.range.odin",
+ "match": "\\.\\.[<=]"
+ },
+ {
+ "name": "keyword.operator.spread.odin",
+ "match": "\\.\\."
+ },
+ {
"name": "keyword.operator.assignment.odin",
"match": ":[:=]|="
},
{
"name": "keyword.operator.address.odin",
- "match": "\\&"
+ "match": "&"
},
{
"name": "keyword.operator.address.odin",
@@ -500,7 +494,7 @@
},
{
"name": "keyword.operator.odin",
- "match": "@|(\\||\\!|:|\\+|-|\\*|/|%|\\<\\<?|\\>\\>?|\\~)=?|=|: : ?|\\.\\.|\\$"
+ "match": "@|(\\||\\!|:|\\+|-|\\*|/|%|\\<\\<?|\\>\\>?|\\~)=?|=|: : ?|\\$"
},
{
"name": "entity.name.tag.odin",
@@ -570,34 +564,31 @@
},
"strings": {
"patterns": [
- { "include": "#strings-quoted-double" },
- { "include": "#strings-quoted-single" },
- { "include": "#strings-quoted-raw" }
+ {
+ "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.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" } ]
+ },
+ {
+ "name": "string.quoted.raw.odin",
+ "begin": "`",
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
+ "end": "`",
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } }
+ }
]
},
- "strings-quoted-double": {
- "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" } ]
- },
- "strings-quoted-single": {
- "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" } ]
- },
- "strings-quoted-raw": {
- "name": "string.quoted.raw.odin",
- "begin": "`",
- "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
- "end": "`",
- "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } }
- },
"string-escaped-char": {
"patterns": [
{
@@ -615,12 +606,8 @@
]
},
"punctuation": {
- "patterns": [
- {
- "name": "punctuation.odin",
- "match": "\\(|\\)|\\{|\\}|;|\\[|\\]|\\.|,|\\\\"
- }
- ]
+ "name": "punctuation.odin",
+ "match": "\\(|\\)|\\{|\\}|;|\\[|\\]|\\.|,|\\\\"
}
},
"scopeName": "source.odin"