site/node_modules/shiki/dist/langs/rust.mjs

7 lines
19 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Rust", "name": "rust", "patterns": [{ "begin": "(<)(\\[)", "beginCaptures": { "1": { "name": "punctuation.brackets.angle.rust" }, "2": { "name": "punctuation.brackets.square.rust" } }, "comment": "boxed slice literal", "end": ">", "endCaptures": { "0": { "name": "punctuation.brackets.angle.rust" } }, "patterns": [{ "include": "#block-comments" }, { "include": "#comments" }, { "include": "#gtypes" }, { "include": "#lvariables" }, { "include": "#lifetimes" }, { "include": "#punctuation" }, { "include": "#types" }] }, { "captures": { "1": { "name": "keyword.operator.macro.dollar.rust" }, "3": { "name": "keyword.other.crate.rust" }, "4": { "name": "entity.name.type.metavariable.rust" }, "6": { "name": "keyword.operator.key-value.rust" }, "7": { "name": "variable.other.metavariable.specifier.rust" } }, "comment": "macro type metavariables", "match": "(\\$)((crate)|([A-Z][A-Za-z0-9_]*))((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", "name": "meta.macro.metavariable.type.rust", "patterns": [{ "include": "#keywords" }] }, { "captures": { "1": { "name": "keyword.operator.macro.dollar.rust" }, "2": { "name": "variable.other.metavariable.name.rust" }, "4": { "name": "keyword.operator.key-value.rust" }, "5": { "name": "variable.other.metavariable.specifier.rust" } }, "comment": "macro metavariables", "match": "(\\$)([a-z][A-Za-z0-9_]*)((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", "name": "meta.macro.metavariable.rust", "patterns": [{ "include": "#keywords" }] }, { "captures": { "1": { "name": "entity.name.function.macro.rules.rust" }, "3": { "name": "entity.name.function.macro.rust" }, "4": { "name": "entity.name.type.macro.rust" }, "5": { "name": "punctuation.brackets.curly.rust" } }, "comment": "macro rules", "match": "\\b(macro_rules!)\\s+(([a-z0-9_]+)|([A-Z][a-z0-9_]*))\\s+(\\{)", "name": "meta.macro.rules.rust" }, { "captures": { "1": { "name": "storage.type.rust" }, "2": { "name": "entity.name.module.rust" } }, "comment": "modules", "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)" }, { "begin": "\\b(extern)\\s+(crate)", "beginCaptures": { "1": { "name": "storage.type.rust" }, "2": { "name": "keyword.other.crate.rust" } }, "comment": "external crate imports", "end": ";", "endCaptures": { "0": { "name": "punctuation.semi.rust" } }, "name": "meta.import.rust", "patterns": [{ "include": "#block-comments" }, { "include": "#comments" }, { "include": "#keywords" }, { "include": "#punctuation" }] }, { "begin": "\\b(use)\\s", "beginCaptures": { "1": { "name": "keyword.other.rust" } }, "comment": "use statements", "end": ";", "endCaptures": { "0": { "name": "punctuation.semi.rust" } }, "name": "meta.use.rust", "patterns": [{ "include": "#block-comments" }, { "include": "#comments" }, { "include": "#keywords" }, { "include": "#namespaces" }, { "include": "#punctuation" }, { "include": "#types" }, { "include": "#lvariables" }] }, { "include": "#block-comments" }, { "include": "#comments" }, { "include": "#attributes" }, { "include": "#lvariables" }, { "include": "#constants" }, { "include": "#gtypes" }, { "include": "#functions" }, { "include": "#types" }, { "include": "#keywords" }, { "include": "#lifetimes" }, { "include": "#macros" }, { "include": "#namespaces" }, { "include": "#punctuation" }, { "include": "#strings" }, { "include": "#variables" }], "repository": { "attributes": { "begin": "(#)(\\!?)(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.attribute.rust" }, "3": { "name": "punctuation.brackets.attribute.rust" } }, "comment": "attributes", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.brackets.attribute.rust" } }, "name": "meta.attribute.rust", "patterns": [{ "include": "#block-comments" }, { "include": "#comments" }, { "include": "#keywords" }, { "include": "#lifetimes" }, { "include": "#punctuation" }, { "include": "#strings" }, { "include": "#gtypes" }, { "include": "#types" }] }, "block-comments": { "patterns": [{ "comment": "empty block comments", "match": "/\\*\\*/", "n
var rust = [
lang
];
export { rust as default };