"use strict"; /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ define("vs/basic-languages/protobuf/protobuf", ["require"],(require)=>{ var moduleExports = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/basic-languages/protobuf/protobuf.ts var protobuf_exports = {}; __export(protobuf_exports, { conf: () => conf, language: () => language }); var namedLiterals = ["true", "false"]; var conf = { comments: { lineComment: "//", blockComment: ["/*", "*/"] }, brackets: [ ["{", "}"], ["[", "]"], ["(", ")"], ["<", ">"] ], surroundingPairs: [ { open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: "<", close: ">" }, { open: '"', close: '"' }, { open: "'", close: "'" } ], autoClosingPairs: [ { open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: "<", close: ">" }, { open: '"', close: '"', notIn: ["string"] }, { open: "'", close: "'", notIn: ["string"] } ], autoCloseBefore: ".,=}])>' \n ", indentationRules: { increaseIndentPattern: new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"), decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$") } }; var language = { defaultToken: "", tokenPostfix: ".proto", brackets: [ { open: "{", close: "}", token: "delimiter.curly" }, { open: "[", close: "]", token: "delimiter.square" }, { open: "(", close: ")", token: "delimiter.parenthesis" }, { open: "<", close: ">", token: "delimiter.angle" } ], symbols: /[=>/, { token: "@brackets", bracket: "@close", switchTo: "identifier" }] ], field: [ { include: "@whitespace" }, [ "group", { cases: { "$S2==proto2": { token: "keyword", switchTo: "@groupDecl.$S2" } } } ], [/(@identifier)(\s*)(=)/, ["identifier", "white", { token: "delimiter", next: "@pop" }]], [ /@fullIdentifier|\./, { cases: { "@builtinTypes": "keyword", "@default": "type.identifier" } } ] ], groupDecl: [ { include: "@whitespace" }, [/@identifier/, "identifier"], ["=", "operator"], [/{/, { token: "@brackets", bracket: "@open", switchTo: "@messageBody.$S2" }], { include: "@constant" } ], type: [ { include: "@whitespace" }, [/@identifier/, "type.identifier", "@pop"], [/./, "delimiter"] ], identifier: [{ include: "@whitespace" }, [/@identifier/, "identifier", "@pop"]], serviceDecl: [ { include: "@whitespace" }, [/@identifier/, "identifier"], [/{/, { token: "@brackets", bracket: "@open", switchTo: "@serviceBody.$S2" }] ], serviceBody: [ { include: "@whitespace" }, { include: "@constant" }, [/;/, "delimiter"], [/option\b/, "keyword", "@option.$S2"], [/rpc\b/, "keyword", "@rpc.$S2"], [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }], [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }] ], rpc: [ { include: "@whitespace" }, [/@identifier/, "identifier"], [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@request.$S2" }], [/{/, { token: "@brackets", bracket: "@open", next: "@methodOptions.$S2" }], [/;/, "delimiter", "@pop"] ], request: [ { include: "@whitespace" }, [ /@messageType/, { cases: { stream: { token: "keyword", next: "@type.$S2" }, "@default": "type.identifier" } } ], [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@returns.$S2" }] ], returns: [ { include: "@whitespace" }, [/returns\b/, "keyword"], [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@response.$S2" }] ], response: [ { include: "@whitespace" }, [ /@messageType/, { cases: { stream: { token: "keyword", next: "@type.$S2" }, "@default": "type.identifier" } } ], [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@rpc.$S2" }] ], methodOptions: [ { include: "@whitespace" }, { include: "@constant" }, [/;/, "delimiter"], ["option", "keyword"], [/@optionName/, "annotation"], [/[()]/, "annotation.brackets"], [/=/, "operator"], [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }] ], comment: [ [/[^\/*]+/, "comment"], [/\/\*/, "comment", "@push"], ["\\*/", "comment", "@pop"], [/[\/*]/, "comment"] ], string: [ [/[^\\"]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }] ], stringSingle: [ [/[^\\']+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }] ], constant: [ ["@boolLit", "keyword.constant"], ["@hexLit", "number.hex"], ["@octalLit", "number.octal"], ["@decimalLit", "number"], ["@floatLit", "number.float"], [/("([^"\\]|\\.)*|'([^'\\]|\\.)*)$/, "string.invalid"], [/"/, { token: "string.quote", bracket: "@open", next: "@string" }], [/'/, { token: "string.quote", bracket: "@open", next: "@stringSingle" }], [/{/, { token: "@brackets", bracket: "@open", next: "@prototext" }], [/identifier/, "identifier"] ], whitespace: [ [/[ \t\r\n]+/, "white"], [/\/\*/, "comment", "@comment"], [/\/\/.*$/, "comment"] ], prototext: [ { include: "@whitespace" }, { include: "@constant" }, [/@identifier/, "identifier"], [/[:;]/, "delimiter"], [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }] ] } }; return __toCommonJS(protobuf_exports); })(); return moduleExports; });