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

7 lines
6.9 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Protocol Buffer 3", "fileTypes": ["proto"], "name": "proto", "patterns": [{ "include": "#comments" }, { "include": "#syntax" }, { "include": "#package" }, { "include": "#import" }, { "include": "#optionStmt" }, { "include": "#message" }, { "include": "#enum" }, { "include": "#service" }], "repository": { "comments": { "patterns": [{ "begin": "/\\*", "end": "\\*/", "name": "comment.block.proto" }, { "begin": "//", "end": "$\\n?", "name": "comment.line.double-slash.proto" }] }, "constants": { "match": "\\b(true|false|max|[A-Z_]+)\\b", "name": "constant.language.proto" }, "enum": { "begin": "(enum)(\\s+)([A-Za-z][A-Za-z0-9_]*)(\\s*)(\\{)?", "beginCaptures": { "1": { "name": "keyword.other.proto" }, "3": { "name": "entity.name.class.proto" } }, "end": "\\}", "patterns": [{ "include": "#reserved" }, { "include": "#optionStmt" }, { "include": "#comments" }, { "begin": "([A-Za-z][A-Za-z0-9_]*)\\s*(=)\\s*(0[xX][0-9a-fA-F]+|[0-9]+)", "beginCaptures": { "1": { "name": "variable.other.proto" }, "2": { "name": "keyword.operator.assignment.proto" }, "3": { "name": "constant.numeric.proto" } }, "end": "(;)", "endCaptures": { "1": { "name": "punctuation.terminator.proto" } }, "patterns": [{ "include": "#fieldOptions" }] }] }, "field": { "begin": "\\s*(optional|repeated|required)?\\s*\\b([\\w.]+)\\s+(\\w+)\\s*(=)\\s*(0[xX][0-9a-fA-F]+|[0-9]+)", "beginCaptures": { "1": { "name": "storage.modifier.proto" }, "2": { "name": "storage.type.proto" }, "3": { "name": "variable.other.proto" }, "4": { "name": "keyword.operator.assignment.proto" }, "5": { "name": "constant.numeric.proto" } }, "end": "(;)", "endCaptures": { "1": { "name": "punctuation.terminator.proto" } }, "patterns": [{ "include": "#fieldOptions" }] }, "fieldOptions": { "begin": "\\[", "end": "\\]", "patterns": [{ "include": "#constants" }, { "include": "#number" }, { "include": "#string" }, { "include": "#subMsgOption" }, { "include": "#optionName" }] }, "ident": { "match": "[A-Za-z][A-Za-z0-9_]*", "name": "entity.name.class.proto" }, "import": { "captures": { "1": { "name": "keyword.other.proto" }, "2": { "name": "keyword.other.proto" }, "3": { "name": "string.quoted.double.proto.import" }, "4": { "name": "punctuation.terminator.proto" } }, "match": '\\s*(import)\\s+(weak|public)?\\s*("[^"]+")\\s*(;)' }, "kv": { "begin": "(\\w+)\\s*(:)", "beginCaptures": { "1": { "name": "keyword.other.proto" }, "2": { "name": "punctuation.separator.key-value.proto" } }, "end": "(;)|,|(?=[}/_a-zA-Z])", "endCaptures": { "1": { "name": "punctuation.terminator.proto" } }, "patterns": [{ "include": "#constants" }, { "include": "#number" }, { "include": "#string" }, { "include": "#subMsgOption" }] }, "mapfield": { "begin": "\\s*(map)\\s*(<)\\s*([\\w.]+)\\s*,\\s*([\\w.]+)\\s*(>)\\s+(\\w+)\\s*(=)\\s*(\\d+)", "beginCaptures": { "1": { "name": "storage.type.proto" }, "2": { "name": "punctuation.definition.typeparameters.begin.proto" }, "3": { "name": "storage.type.proto" }, "4": { "name": "storage.type.proto" }, "5": { "name": "punctuation.definition.typeparameters.end.proto" }, "6": { "name": "variable.other.proto" }, "7": { "name": "keyword.operator.assignment.proto" }, "8": { "name": "constant.numeric.proto" } }, "end": "(;)", "endCaptures": { "1": { "name": "punctuation.terminator.proto" } }, "patterns": [{ "include": "#fieldOptions" }] }, "message": { "begin": "(message|extend)(\\s+)([A-Za-z_][A-Za-z0-9_.]*)(\\s*)(\\{)?", "beginCaptures": { "1": { "name": "keyword.other.proto" }, "3": { "name": "entity.name.class.message.proto" } }, "end": "\\}", "patterns": [{ "include": "#reserved" }, { "include": "$self" }, { "include": "#enum" }, { "include": "#optionStmt" }, { "include": "#comments" }, { "include": "#oneof" }, { "include": "#field" }, { "include": "#mapfield" }] }, "method": { "begin": "(rpc)\\s+([A-Za-z][A-Za-z0-9_]*)", "beginCaptures": { "1": { "name": "keyword.other.proto" }, "2": { "name": "entity.name.function" } }, "end": "\\}|(;)", "endCaptures": { "1": { "name": "punctuation.terminator.proto" } }, "patterns": [{ "include": "#comments" }, { "
var proto = [
lang
];
export { proto as default };