From a753ee32c57b6d0b4be46e7e48fdf3e82e9c1e21 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 4 Jul 2026 06:43:24 +0200 Subject: [PATCH] Patch language grammar --- src/components/mist.tmLanguage.json | 1018 +++++++++++++-------------- 1 file changed, 509 insertions(+), 509 deletions(-) diff --git a/src/components/mist.tmLanguage.json b/src/components/mist.tmLanguage.json index 5aa3f27..fecbd4f 100644 --- a/src/components/mist.tmLanguage.json +++ b/src/components/mist.tmLanguage.json @@ -1,512 +1,512 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "mist", - "scopeName": "source.mist", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#strings" - }, - { - "include": "#attributes" - }, - { - "include": "#macros" - }, - { - "include": "#type_declarations" - }, - { - "include": "#keywords" - }, - { - "include": "#numbers" - }, - { - "include": "#lifetimes" - }, - { - "include": "#generics" - }, - { - "include": "#types" - }, - { - "include": "#imports" - }, - { - "include": "#modules" - }, - { - "include": "#struct_literals" - }, - { - "include": "#impl" - }, - { - "include": "#method_calls" - }, - { - "include": "#field_access" - }, - { - "include": "#arrow" - }, - { - "include": "#return_arrow" - }, - { - "include": "#functions" - }, - { - "include": "#path_continuation" - }, - { - "include": "#operators" - }, - { - "include": "#punctuation" - }, - { - "include": "#variables" - } - ], - "repository": { - "comments": { - "name": "comment.line.double-slash.mist", - "match": "//.*" - }, - "strings": { - "name": "string.quoted.double.mist", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.mist" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.mist" - } - }, - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.mist" - } - ] - }, - "attributes": { - "name": "meta.attribute.mist", - "begin": "#!?\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.attribute.begin.mist" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.attribute.end.mist" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - "macros": { - "patterns": [ - { - "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.macro.mist" - }, - "2": { - "name": "keyword.operator.macro.mist" - }, - "3": { - "name": "punctuation.parenthesis.begin.mist" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.parenthesis.end.mist" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\[)", - "beginCaptures": { - "1": { - "name": "entity.name.function.macro.mist" - }, - "2": { - "name": "keyword.operator.macro.mist" - }, - "3": { - "name": "punctuation.bracket.begin.mist" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.bracket.end.mist" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\{)", - "beginCaptures": { - "1": { - "name": "entity.name.function.macro.mist" - }, - "2": { - "name": "keyword.operator.macro.mist" - }, - "3": { - "name": "punctuation.curly.brace.begin.mist" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.curly.brace.end.mist" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "type_declarations": { - "patterns": [ - { - "match": "\\b(struct|enum|class|trait)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "captures": { - "1": { - "name": "storage.type.mist" - }, - "2": { - "name": "entity.name.type.mist" - } - } - }, - { - "match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "captures": { - "1": { - "name": "storage.type.mist" - }, - "2": { - "patterns": [ - { - "include": "#types" - } - ] - }, - "3": { - "name": "entity.name.function.mist" - } - } - } - ] - }, - "keywords": { - "patterns": [ - { - "match": "\\b(if|else|while|for|return|break|continue|match|loop|in)\\b", - "name": "keyword.control.mist" - }, - { - "match": "\\b(struct|enum|class|trait|fn|let|impl|class)\\b", - "name": "storage.modifier.mist" - }, - { - "match": "\\b(pub|mut|use|module|as|dyn|unsafe|self|super|Super|constructor|override)\\b", - "name": "keyword.other.mist" - }, - { - "match": "\\b(true|false)\\b", - "name": "constant.language.boolean.mist" - } - ] - }, - "numbers": { - "patterns": [ - { - "match": "\\b\\d+\\.\\d+\\b", - "name": "constant.numeric.float.mist" - }, - { - "match": "\\b\\d+\\b", - "name": "constant.numeric.integer.mist" - } - ] - }, - "lifetimes": { - "match": "'[a-zA-Z_][a-zA-Z0-9_]*\\b", - "name": "storage.modifier.lifetime.mist" - }, - "generics": { - "patterns": [ - { - "begin": "(?<=[a-zA-Z0-9_>])<(?![=<>])", - "beginCaptures": { - "0": { - "name": "punctuation.brackets.angle.mist" - } - }, - "end": "(?", - "endCaptures": { - "0": { - "name": "punctuation.brackets.angle.mist" - } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#strings" - }, - { - "include": "#lifetimes" - }, - { - "include": "#types" - }, - { - "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b", - "name": "entity.name.type.mist" - }, - { - "match": ",", - "name": "punctuation.separator.mist" - }, - { - "match": "[:+]", - "name": "keyword.operator.mist" - }, - { - "include": "#field_access" - }, - { - "include": "#path_continuation" - }, - { - "include": "#generics" - } - ] - } - ] - }, - "types": { - "patterns": [ - { - "match": "(?", - "name": "keyword.operator.arrow.mist" - }, - "return_arrow": { - "match": "->", - "name": "keyword.operator.arrow.mist" - }, - "functions": { - "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()", - "name": "entity.name.function.mist" - }, - "impl": { - "patterns": [ - { - "match": "\\b(impl)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+for\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "captures": { - "1": { - "name": "storage.type.mist" - }, - "2": { - "patterns": [ - { - "include": "#types" - } - ] - }, - "3": { - "patterns": [ - { - "include": "#types" - } - ] - } - } - }, - { - "match": "\\b(impl)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+", - "captures": { - "1": { - "name": "storage.type.mist" - }, - "2": { - "patterns": [ - { - "include": "#types" - } - ] - } - } - } - ] - }, - "operators": { - "patterns": [ - { - "match": "(?:\\+=|-=|\\*=|\\/=|%=|&=|\\|=|\\^=|<<=|>>=|<<|>>|\\.\\.=|\\.\\.|<=|>=|==|!=|&&|\\|\\||[+\\-*/%<>&|^=!]|\\+\\+|--|:)", - "name": "keyword.operator.mist" - } - ] - }, - "punctuation": { - "match": "::|:|;|,|\\.|\\{|\\}|\\(|\\)|\\[|\\]|\\?", - "name": "punctuation.mist" - }, - "variables": { - "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b", - "name": "variable.other.mist" - } + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "mist", + "scopeName": "source.mist", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#strings" + }, + { + "include": "#attributes" + }, + { + "include": "#macros" + }, + { + "include": "#type_declarations" + }, + { + "include": "#keywords" + }, + { + "include": "#numbers" + }, + { + "include": "#lifetimes" + }, + { + "include": "#generics" + }, + { + "include": "#types" + }, + { + "include": "#imports" + }, + { + "include": "#modules" + }, + { + "include": "#struct_literals" + }, + { + "include": "#impl" + }, + { + "include": "#method_calls" + }, + { + "include": "#field_access" + }, + { + "include": "#arrow" + }, + { + "include": "#return_arrow" + }, + { + "include": "#functions" + }, + { + "include": "#path_continuation" + }, + { + "include": "#operators" + }, + { + "include": "#punctuation" + }, + { + "include": "#variables" } + ], + "repository": { + "comments": { + "name": "comment.line.double-slash.mist", + "match": "//.*" + }, + "strings": { + "name": "string.quoted.double.mist", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.mist" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.mist" + } + }, + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.mist" + } + ] + }, + "attributes": { + "name": "meta.attribute.mist", + "begin": "#!?\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.attribute.begin.mist" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.attribute.end.mist" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + "macros": { + "patterns": [ + { + "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.macro.mist" + }, + "2": { + "name": "keyword.operator.macro.mist" + }, + "3": { + "name": "punctuation.parenthesis.begin.mist" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.end.mist" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\[)", + "beginCaptures": { + "1": { + "name": "entity.name.function.macro.mist" + }, + "2": { + "name": "keyword.operator.macro.mist" + }, + "3": { + "name": "punctuation.bracket.begin.mist" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.bracket.end.mist" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(!)(\\{)", + "beginCaptures": { + "1": { + "name": "entity.name.function.macro.mist" + }, + "2": { + "name": "keyword.operator.macro.mist" + }, + "3": { + "name": "punctuation.curly.brace.begin.mist" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curly.brace.end.mist" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "type_declarations": { + "patterns": [ + { + "match": "\\b(struct|enum|class|trait|type)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "storage.type.mist" + }, + "2": { + "name": "entity.name.type.mist" + } + } + }, + { + "match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "storage.type.mist" + }, + "2": { + "patterns": [ + { + "include": "#types" + } + ] + }, + "3": { + "name": "entity.name.function.mist" + } + } + } + ] + }, + "keywords": { + "patterns": [ + { + "match": "\\b(if|else|while|for|return|break|continue|match|loop|in)\\b", + "name": "keyword.control.mist" + }, + { + "match": "\\b(struct|enum|class|trait|fn|let|impl|type|const)\\b", + "name": "storage.modifier.mist" + }, + { + "match": "\\b(pub|mut|use|module|as|dyn|unsafe|self|super|Super|constructor|override)\\b", + "name": "keyword.other.mist" + }, + { + "match": "\\b(true|false)\\b", + "name": "constant.language.boolean.mist" + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "\\b\\d+\\.\\d+\\b", + "name": "constant.numeric.float.mist" + }, + { + "match": "\\b\\d+\\b", + "name": "constant.numeric.integer.mist" + } + ] + }, + "lifetimes": { + "match": "'[a-zA-Z_][a-zA-Z0-9_]*\\b", + "name": "storage.modifier.lifetime.mist" + }, + "generics": { + "patterns": [ + { + "begin": "(?<=[a-zA-Z0-9_>])<(?![=<>])", + "beginCaptures": { + "0": { + "name": "punctuation.brackets.angle.mist" + } + }, + "end": "(?", + "endCaptures": { + "0": { + "name": "punctuation.brackets.angle.mist" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#strings" + }, + { + "include": "#lifetimes" + }, + { + "include": "#types" + }, + { + "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b", + "name": "entity.name.type.mist" + }, + { + "match": ",", + "name": "punctuation.separator.mist" + }, + { + "match": "[:+]", + "name": "keyword.operator.mist" + }, + { + "include": "#field_access" + }, + { + "include": "#path_continuation" + }, + { + "include": "#generics" + } + ] + } + ] + }, + "types": { + "patterns": [ + { + "match": "(?", + "name": "keyword.operator.arrow.mist" + }, + "return_arrow": { + "match": "->", + "name": "keyword.operator.arrow.mist" + }, + "functions": { + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()", + "name": "entity.name.function.mist" + }, + "impl": { + "patterns": [ + { + "match": "\\b(impl)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+for\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "storage.type.mist" + }, + "2": { + "patterns": [ + { + "include": "#types" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#types" + } + ] + } + } + }, + { + "match": "\\b(impl)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s+", + "captures": { + "1": { + "name": "storage.type.mist" + }, + "2": { + "patterns": [ + { + "include": "#types" + } + ] + } + } + } + ] + }, + "operators": { + "patterns": [ + { + "match": "(?:\\+=|-=|\\*=|\\/=|%=|&=|\\|=|\\^=|<<=|>>=|<<|>>|\\.\\.=|\\.\\.|<=|>=|==|!=|&&|\\|\\||[+\\-*/%<>&|^=!]|\\+\\+|--|:)", + "name": "keyword.operator.mist" + } + ] + }, + "punctuation": { + "match": "::|:|;|,|\\.|\\{|\\}|\\(|\\)|\\[|\\]|\\?", + "name": "punctuation.mist" + }, + "variables": { + "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b", + "name": "variable.other.mist" + } + } } \ No newline at end of file