Warp/node_modules/shikiji/dist/langs/go.mjs

7 lines
17 KiB
JavaScript
Raw Normal View History

2024-01-05 12:14:38 +00:00
const lang = Object.freeze({ "displayName": "Go", "name": "go", "patterns": [{ "include": "#comments" }, { "include": "#comments" }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.go" } }, "comment": "Interpreted string literals", "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.go" } }, "name": "string.quoted.double.go", "patterns": [{ "include": "#string_escaped_char" }, { "include": "#string_placeholder" }] }, { "begin": "`", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.go" } }, "comment": "Raw string literals", "end": "`", "endCaptures": { "0": { "name": "punctuation.definition.string.end.go" } }, "name": "string.quoted.raw.go", "patterns": [{ "include": "#string_placeholder" }] }, { "captures": { "1": { "name": "invalid.illegal.receive-channel.go" } }, "comment": "Syntax error receiving channels", "match": "<\\-([\\t ]+)chan\\b" }, { "captures": { "1": { "name": "invalid.illegal.send-channel.go" } }, "comment": "Syntax error sending channels", "match": "\\bchan([\\t ]+)<-" }, { "captures": { "1": { "name": "invalid.illegal.slice.go" } }, "comment": "Syntax error using slices", "match": "\\[\\](\\s+)" }, { "comment": "Syntax error numeric literals", "match": "\\b0[0-7]*[89]\\d*\\b", "name": "invalid.illegal.numeric.go" }, { "comment": "Built-in functions", "match": "\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\()", "name": "support.function.builtin.go" }, { "captures": { "1": { "name": "keyword.function.go" }, "2": { "patterns": [{ "include": "#brackets" }, { "include": "#operators" }] }, "3": { "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "match": "\\w+", "name": "entity.name.function.go" }] } }, "comment": "Function declarations", "match": "^(\\bfunc\\b)(?:\\s+(\\([^\\)]+\\)\\s+)?(\\w+)(?=\\())?" }, { "captures": { "1": { "name": "keyword.function.go" }, "2": { "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "match": "\\w+", "name": "support.function.go" }] } }, "comment": "Functions", "match": "(\\bfunc\\b)|(\\w+)(?=\\()" }, { "include": "#numeric_literals" }, { "comment": "Language constants", "match": "\\b(true|false|nil|iota)\\b", "name": "constant.language.go" }, { "begin": "\\b(package)\\s+", "beginCaptures": { "1": { "name": "keyword.package.go" } }, "end": "(?!\\G)", "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "match": "\\w+", "name": "entity.name.package.go" }] }, { "begin": "\\b(type)\\s+", "beginCaptures": { "1": { "name": "keyword.type.go" } }, "end": "(?!\\G)", "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "match": "\\w+", "name": "entity.name.type.go" }] }, { "begin": "\\b(import)\\s+", "beginCaptures": { "1": { "name": "keyword.import.go" } }, "end": "(?!\\G)", "patterns": [{ "include": "#imports" }] }, { "begin": "\\b(var)\\s+", "beginCaptures": { "1": { "name": "keyword.var.go" } }, "end": "(?!\\G)", "patterns": [{ "include": "#variables" }] }, { "captures": { "1": { "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "captures": { "0": { "patterns": [{ "include": "#delimiters" }] } }, "match": "\\w+(?:\\.\\w+)*", "name": "variable.other.assignment.go" }, { "include": "#delimiters" }] } }, "match": "(?<!var)\\s*(\\w+(?:\\.\\w+)*(?>,\\s*\\w+(?:\\.\\w+)*)*)(?=\\s*=(?!=))" }, { "captures": { "0": { "patterns": [{ "match": "\\d\\w*", "name": "invalid.illegal.identifier.go" }, { "match": "\\w+", "name": "variable.other.assignment.go" }, { "include": "#delimiters" }] } }, "match": "\\b\\w+(?:,\\s*\\w+)*(?=\\s*:=)" }, { "comment": "Terminators", "match": ";", "name": "punctuation.terminator.go" }, { "include": "#brackets" }, { "include": "#delimiters" }, { "include": "#keywords" }, { "include": "#operators" }, { "include": "#runes" }, { "include": "#storage_types" }], "repository": { "brackets": { "patterns": [{ "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.begin.brack
var go = [
lang
];
export { go as default };