"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/ruby/ruby", ["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/ruby/ruby.ts var ruby_exports = {}; __export(ruby_exports, { conf: () => conf, language: () => language }); var conf = { comments: { lineComment: "#", blockComment: ["=begin", "=end"] }, brackets: [ ["(", ")"], ["{", "}"], ["[", "]"] ], autoClosingPairs: [ { open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" } ], surroundingPairs: [ { open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" } ], indentationRules: { increaseIndentPattern: new RegExp(`^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|("|'|/).*\\4)*(#.*)?$`), decreaseIndentPattern: new RegExp("^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)") } }; var language = { tokenPostfix: ".ruby", keywords: [ "__LINE__", "__ENCODING__", "__FILE__", "BEGIN", "END", "alias", "and", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "end", "ensure", "for", "false", "if", "in", "module", "next", "nil", "not", "or", "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", "until", "when", "while", "yield" ], keywordops: ["::", "..", "...", "?", ":", "=>"], builtins: [ "require", "public", "private", "include", "extend", "attr_reader", "protected", "private_class_method", "protected_class_method", "new" ], declarations: [ "module", "class", "def", "case", "do", "begin", "for", "if", "while", "until", "unless" ], linedecls: ["def", "case", "do", "begin", "for", "if", "while", "until", "unless"], operators: [ "^", "&", "|", "<=>", "==", "===", "!~", "=~", ">", ">=", "<", "<=", "<<", ">>", "+", "-", "*", "/", "%", "**", "~", "+@", "-@", "[]", "[]=", "`", "+=", "-=", "*=", "**=", "/=", "^=", "%=", "<<=", ">>=", "&=", "&&=", "||=", "|=" ], brackets: [ { open: "(", close: ")", token: "delimiter.parenthesis" }, { open: "{", close: "}", token: "delimiter.curly" }, { open: "[", close: "]", token: "delimiter.square" } ], symbols: /[=>" }], [/%([qws])(@delim)/, { token: "string.$1.delim", switchTo: "@qstring.$1.$2.$2" }], [/%r\(/, { token: "regexp.delim", switchTo: "@pregexp.(.)" }], [/%r\[/, { token: "regexp.delim", switchTo: "@pregexp.[.]" }], [/%r\{/, { token: "regexp.delim", switchTo: "@pregexp.{.}" }], [/%r" }], [/%r(@delim)/, { token: "regexp.delim", switchTo: "@pregexp.$1.$1" }], [/%(x|W|Q?)\(/, { token: "string.$1.delim", switchTo: "@qqstring.$1.(.)" }], [/%(x|W|Q?)\[/, { token: "string.$1.delim", switchTo: "@qqstring.$1.[.]" }], [/%(x|W|Q?)\{/, { token: "string.$1.delim", switchTo: "@qqstring.$1.{.}" }], [/%(x|W|Q?)" }], [/%(x|W|Q?)(@delim)/, { token: "string.$1.delim", switchTo: "@qqstring.$1.$2.$2" }], [/%([rqwsxW]|Q?)./, { token: "invalid", next: "@pop" }], [/./, { token: "invalid", next: "@pop" }] ], qstring: [ [/\\$/, "string.$S2.escape"], [/\\./, "string.$S2.escape"], [ /./, { cases: { "$#==$S4": { token: "string.$S2.delim", next: "@pop" }, "$#==$S3": { token: "string.$S2.delim", next: "@push" }, "@default": "string.$S2" } } ] ], qqstring: [[/#/, "string.$S2.escape", "@interpolated"], { include: "@qstring" }], whitespace: [ [/[ \t\r\n]+/, ""], [/^\s*=begin\b/, "comment", "@comment"], [/#.*$/, "comment"] ], comment: [ [/[^=]+/, "comment"], [/^\s*=begin\b/, "comment.invalid"], [/^\s*=end\b.*/, "comment", "@pop"], [/[=]/, "comment"] ] } }; return __toCommonJS(ruby_exports); })(); return moduleExports; });