Basic highlighting

This commit is contained in:
2026-04-13 18:03:12 +02:00
parent 290ee0f446
commit 2d13e07b84
2 changed files with 82 additions and 27 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
}], }],
"grammars": [{ "grammars": [{
"language": "mist", "language": "mist",
"scopeName": "source.ms", "scopeName": "source.mist",
"path": "./syntaxes/mist.tmLanguage.json" "path": "./syntaxes/mist.tmLanguage.json"
}] }]
} }
+81 -26
View File
@@ -1,32 +1,87 @@
{ {
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Mist", "name": "Mist",
"scopeName": "source.mist",
"patterns": [ "patterns": [
{ { "include": "#comments" },
"include": "#keywords" { "include": "#keywords" },
}, { "include": "#strings" },
{ { "include": "#numbers" },
"include": "#strings" { "include": "#types" },
} { "include": "#operators" }
], ],
"repository": { "repository": {
"keywords": { "comments": {
"patterns": [{ "patterns": [
"name": "keyword.control.mist", {
"match": "\\b(if|while|for|return)\\b" "name": "comment.line.double-slash.mist",
}] "match": "//.*$"
}, }
"strings": { ]
"name": "string.quoted.double.mist", },
"begin": "\"",
"end": "\"", "keywords": {
"patterns": [ "patterns": [
{ {
"name": "constant.character.escape.mist", "name": "keyword.control.flow.mist",
"match": "\\\\." "match": "\\b(if|else|for|return|function|class|struct|import|let|const)\\b"
} },
] {
} "name": "constant.language.null.mist",
}, "match": "\\b(null)\\b"
"scopeName": "source.ms" },
} {
"name": "constant.language.this.mist",
"match": "\\b(this)\\b"
},
{
"name": "constant.language.boolean.mist",
"match": "\\b(true|false)\\b"
}
]
},
"strings": {
"name": "string.quoted.double.mist",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.mist",
"match": "\\\\."
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.float.mist",
"match": "\\b\\d+\\.\\d+\\b"
},
{
"name": "constant.numeric.integer.mist",
"match": "\\b\\d+\\b"
}
]
},
"types": {
"patterns": [
{
"name": "entity.name.type.mist",
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.mist",
"match": "(==|!=|<=|>=|&&|\\|\\||[+\\-*/<>=])"
}
]
}
}
}