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AOD,QAAS4uB,GAGpE3uB,EAAOD,OACf,CCnB0B4uB,CAAoB,I","sources":["webpack://vscodetextmate/webpack/universalModuleDefinition","webpack://vscodetextmate/./out/debug.js","webpack://vscodetextmate/./out/encodedTokenAttributes.js","webpack://vscodetextmate/./out/grammar/basicScopesAttributeProvider.js","webpack://vscodetextmate/./out/grammar/grammar.js","webpack://vscodetextmate/./out/grammar/grammarDependencies.js","webpack://vscodetextmate/./out/grammar/index.js","webpack://vscodetextmate/./out/grammar/tokenizeString.js","webpack://vscodetextmate/./out/json.js","webpack://vscodetextmate/./out/main.js","webpack://vscodetextmate/./out/matcher.js","webpack://vscodetextmate/./out/onigLib.js","webpack://vscodetextmate/./out/parseRawGrammar.js","webpack://vscodetextmate/./out/plist.js","webpack://vscodetextmate/./out/registry.js","webpack://vscodetextmate/./out/rule.js","webpack://vscodetextmate/./out/theme.js","webpack://vscodetextmate/./out/utils.js","webpack://vscodetextmate/webpack/bootstrap","webpack://vscodetextmate/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vscodetextmate\"] = factory();\n\telse\n\t\troot[\"vscodetextmate\"] = factory();\n})(this, function() {\nreturn ","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UseOnigurumaFindOptions = exports.DebugFlags = void 0;\nexports.DebugFlags = {\n InDebugMode: (typeof process !== 'undefined' && !!process.env['VSCODE_TEXTMATE_DEBUG'])\n};\nexports.UseOnigurumaFindOptions = false;\n//# sourceMappingURL=debug.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toOptionalTokenType = exports.EncodedTokenAttributes = void 0;\nvar EncodedTokenAttributes;\n(function (EncodedTokenAttributes) {\n function toBinaryStr(encodedTokenAttributes) {\n let r = encodedTokenAttributes.toString(2);\n while (r.length < 32) {\n r = \"0\" + r;\n }\n return r;\n }\n EncodedTokenAttributes.toBinaryStr = toBinaryStr;\n function print(encodedTokenAttributes) {\n const languageId = EncodedTokenAttributes.getLanguageId(encodedTokenAttributes);\n const tokenType = EncodedTokenAttributes.getTokenType(encodedTokenAttributes);\n const fontStyle = EncodedTokenAttributes.getFontStyle(encodedTokenAttributes);\n const foreground = EncodedTokenAttributes.getForeground(encodedTokenAttributes);\n const background = EncodedTokenAttributes.getBackground(encodedTokenAttributes);\n console.log({\n languageId: languageId,\n tokenType: tokenType,\n fontStyle: fontStyle,\n foreground: foreground,\n background: background,\n });\n }\n EncodedTokenAttributes.print = print;\n function getLanguageId(encodedTokenAttributes) {\n return ((encodedTokenAttributes & 255 /* LANGUAGEID_MASK */) >>>\n 0 /* LANGUAGEID_OFFSET */);\n }\n EncodedTokenAttributes.getLanguageId = getLanguageId;\n function getTokenType(encodedTokenAttributes) {\n return ((encodedTokenAttributes & 768 /* TOKEN_TYPE_MASK */) >>>\n 8 /* TOKEN_TYPE_OFFSET */);\n }\n EncodedTokenAttributes.getTokenType = getTokenType;\n function containsBalancedBrackets(encodedTokenAttributes) {\n return (encodedTokenAttributes & 1024 /* BALANCED_BRACKETS_MASK */) !== 0;\n }\n EncodedTokenAttributes.containsBalancedBrackets = containsBalancedBrackets;\n function getFontStyle(encodedTokenAttributes) {\n return ((encodedTokenAttributes & 30720 /* FONT_STYLE_MASK */) >>>\n 11 /* FONT_STYLE_OFFSET */);\n }\n EncodedTokenAttributes.getFontStyle = getFontStyle;\n function getForeground(encodedTokenAttributes) {\n return ((encodedTokenAttributes & 16744448 /* FOREGROUND_MASK */) >>>\n 15 /* FOREGROUND_OFFSET */);\n }\n EncodedTokenAttributes.getForeground = getForeground;\n function getBackground(encodedTokenAttributes) {\n return ((encodedTokenAttributes & 4278190080 /* BACKGROUND_MASK */) >>>\n 24 /* BACKGROUND_OFFSET */);\n }\n EncodedTokenAttributes.getBackground = getBackground;\n /**\n * Updates the fields in `metadata`.\n * A value of `0`, `NotSet` or `null` indicates that the corresponding field should be left as is.\n */\n function set(encodedTokenAttributes, languageId, tokenType, containsBalancedBrackets, fontStyle, foreground, background) {\n let _languageId = EncodedTokenAttributes.getLanguageId(encodedTokenAttributes);\n let _tokenType = EncodedTokenAttributes.getTokenType(encodedTokenAttributes);\n let _containsBalancedBracketsBit = EncodedTokenAttributes.containsBalancedBrackets(encodedTokenAttributes) ? 1 : 0;\n let _fontStyle = EncodedTokenAttributes.getFontStyle(encodedTokenAttributes);\n let _foreground = EncodedTokenAttributes.getForeground(encodedTokenAttributes);\n let _background = EncodedTokenAttributes.getBackground(encodedTokenAttributes);\n if (languageId !== 0) {\n _languageId = languageId;\n }\n if (tokenType !== 8 /* NotSet */) {\n _tokenType = fromOptionalTokenType(tokenType);\n }\n if (containsBalancedBrackets !== null) {\n _containsBalancedBracketsBit = containsBalancedBrackets ? 1 : 0;\n }\n if (fontStyle !== -1 /* NotSet */) {\n _fontStyle = fontStyle;\n }\n if (foreground !== 0) {\n _foreground = foreground;\n }\n if (background !== 0) {\n _background = background;\n }\n return (((_languageId << 0 /* LANGUAGEID_OFFSET */) |\n (_tokenType << 8 /* TOKEN_TYPE_OFFSET */) |\n (_containsBalancedBracketsBit <<\n 10 /* BALANCED_BRACKETS_OFFSET */) |\n (_fontStyle << 11 /* FONT_STYLE_OFFSET */) |\n (_foreground << 15 /* FOREGROUND_OFFSET */) |\n (_background << 24 /* BACKGROUND_OFFSET */)) >>>\n 0);\n }\n EncodedTokenAttributes.set = set;\n})(EncodedTokenAttributes = exports.EncodedTokenAttributes || (exports.EncodedTokenAttributes = {}));\nfunction toOptionalTokenType(standardType) {\n return standardType;\n}\nexports.toOptionalTokenType = toOptionalTokenType;\nfunction fromOptionalTokenType(standardType) {\n return standardType;\n}\n//# sourceMappingURL=encodedTokenAttributes.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BasicScopeAttributesProvider = exports.BasicScopeAttributes = void 0;\nconst utils_1 = require(\"../utils\");\nclass BasicScopeAttributes {\n constructor(languageId, tokenType) {\n this.languageId = languageId;\n this.tokenType = tokenType;\n }\n}\nexports.BasicScopeAttributes = BasicScopeAttributes;\nclass BasicScopeAttributesProvider {\n constructor(initialLanguageId, embeddedLanguages) {\n this._getBasicScopeAttributes = new utils_1.CachedFn((scopeName) => {\n const languageId = this._scopeToLanguage(scopeName);\n const standardTokenType = this._toStandardTokenType(scopeName);\n return new BasicScopeAttributes(languageId, standardTokenType);\n });\n this._defaultAttributes = new BasicScopeAttributes(initialLanguageId, 8 /* NotSet */);\n this._embeddedLanguagesMatcher = new ScopeMatcher(Object.entries(embeddedLanguages || {}));\n }\n getDefaultAttributes() {\n return this._defaultAttributes;\n }\n getBasicScopeAttributes(scopeName) {\n if (scopeName === null) {\n return BasicScopeAttributesProvider._NULL_SCOPE_METADATA;\n }\n return this._getBasicScopeAttributes.get(scopeName);\n }\n /**\n * Given a produced TM scope, return the language that token describes or null if unknown.\n * e.g. source.html => html, source.css.embedded.html => css, punctuation.definition.tag.html => null\n */\n _scopeToLanguage(scope) {\n return this._embeddedLanguagesMatcher.match(scope) || 0;\n }\n _toStandardTokenType(scopeName) {\n const m = scopeName.match(BasicScopeAttributesProvider.STANDARD_TOKEN_TYPE_REGEXP);\n if (!m) {\n return 8 /* NotSet */;\n }\n switch (m[1]) {\n case \"comment\":\n return 1 /* Comment */;\n case \"string\":\n return 2 /* String */;\n case \"regex\":\n return 3 /* RegEx */;\n case \"meta.embedded\":\n return 0 /* Other */;\n }\n throw new Error(\"Unexpected match for standard token type!\");\n }\n}\nexports.BasicScopeAttributesProvider = BasicScopeAttributesProvider;\nBasicScopeAttributesProvider._NULL_SCOPE_METADATA = new BasicScopeAttributes(0, 0);\nBasicScopeAttributesProvider.STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|meta\\.embedded)\\b/;\nclass ScopeMatcher {\n constructor(values) {\n if (values.length === 0) {\n this.values = null;\n this.scopesRegExp = null;\n }\n else {\n this.values = new Map(values);\n // create the regex\n const escapedScopes = values.map(([scopeName, value]) => utils_1.escapeRegExpCharacters(scopeName));\n escapedScopes.sort();\n escapedScopes.reverse(); // Longest scope first\n this.scopesRegExp = new RegExp(`^((${escapedScopes.join(\")|(\")}))($|\\\\.)`, \"\");\n }\n }\n match(scope) {\n if (!this.scopesRegExp) {\n return undefined;\n }\n const m = scope.match(this.scopesRegExp);\n if (!m) {\n // no scopes matched\n return undefined;\n }\n return this.values.get(m[1]);\n }\n}\n//# sourceMappingURL=basicScopesAttributeProvider.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LineTokens = exports.BalancedBracketSelectors = exports.StateStack = exports.AttributedScopeStack = exports.Grammar = exports.createGrammar = void 0;\nconst debug_1 = require(\"../debug\");\nconst encodedTokenAttributes_1 = require(\"../encodedTokenAttributes\");\nconst matcher_1 = require(\"../matcher\");\nconst onigLib_1 = require(\"../onigLib\");\nconst rule_1 = require(\"../rule\");\nconst theme_1 = require(\"../theme\");\nconst utils_1 = require(\"../utils\");\nconst basicScopesAttributeProvider_1 = require(\"./basicScopesAttributeProvider\");\nconst tokenizeString_1 = require(\"./tokenizeString\");\nfunction createGrammar(scopeName, grammar, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors, grammarRepository, onigLib) {\n return new Grammar(scopeName, grammar, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors, grammarRepository, onigLib); //TODO\n}\nexports.createGrammar = createGrammar;\nfunction collectInjections(result, selector, rule, ruleFactoryHelper, grammar) {\n const matchers = matcher_1.createMatchers(selector, nameMatcher);\n const ruleId = rule_1.RuleFactory.getCompiledRuleId(rule, ruleFactoryHelper, grammar.repository);\n for (const matcher of matchers) {\n result.push({\n debugSelector: selector,\n matcher: matcher.matcher,\n ruleId: ruleId,\n grammar: grammar,\n priority: matcher.priority\n });\n }\n}\nfunction nameMatcher(identifers, scopes) {\n if (scopes.length < identifers.length) {\n return false;\n }\n let lastIndex = 0;\n return identifers.every(identifier => {\n for (let i = lastIndex; i < scopes.length; i++) {\n if (scopesAreMatching(scopes[i], identifier)) {\n lastIndex = i + 1;\n return true;\n }\n }\n return false;\n });\n}\nfunction scopesAreMatching(thisScopeName, scopeName) {\n if (!thisScopeName) {\n return false;\n }\n if (thisScopeName === scopeName) {\n return true;\n }\n const len = scopeName.length;\n return thisScopeName.length > len && thisScopeName.substr(0, len) === scopeName && thisScopeName[len] === '.';\n}\nclass Grammar {\n constructor(_rootScopeName, grammar, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors, grammarRepository, _onigLib) {\n this._rootScopeName = _rootScopeName;\n this.balancedBracketSelectors = balancedBracketSelectors;\n this._onigLib = _onigLib;\n this._basicScopeAttributesProvider = new basicScopesAttributeProvider_1.BasicScopeAttributesProvider(initialLanguage, embeddedLanguages);\n this._rootId = -1;\n this._lastRuleId = 0;\n this._ruleId2desc = [null];\n this._includedGrammars = {};\n this._grammarRepository = grammarRepository;\n this._grammar = initGrammar(grammar, null);\n this._injections = null;\n this._tokenTypeMatchers = [];\n if (tokenTypes) {\n for (const selector of Object.keys(tokenTypes)) {\n const matchers = matcher_1.createMatchers(selector, nameMatcher);\n for (const matcher of matchers) {\n this._tokenTypeMatchers.push({\n matcher: matcher.matcher,\n type: tokenTypes[selector],\n });\n }\n }\n }\n }\n get themeProvider() { return this._grammarRepository; }\n dispose() {\n for (const rule of this._ruleId2desc) {\n if (rule) {\n rule.dispose();\n }\n }\n }\n createOnigScanner(sources) {\n return this._onigLib.createOnigScanner(sources);\n }\n createOnigString(sources) {\n return this._onigLib.createOnigString(sources);\n }\n getMetadataForScope(scope) {\n return this._basicScopeAttributesProvider.getBasicScopeAttributes(scope);\n }\n _collectInjections() {\n const grammarRepository = {\n lookup: (scopeName) => {\n if (scopeName === this._rootScopeName) {\n return this._grammar;\n }\n return this.getExternalGrammar(scopeName);\n },\n injections: (scopeName) => {\n return this._grammarRepository.injections(scopeName);\n },\n };\n const result = [];\n const scopeName = this._rootScopeName;\n const grammar = grammarRepository.lookup(scopeName);\n if (grammar) {\n // add injections from the current grammar\n const rawInjections = grammar.injections;\n if (rawInjections) {\n for (let expression in rawInjections) {\n collectInjections(result, expression, rawInjections[expression], this, grammar);\n }\n }\n // add injection grammars contributed for the current scope\n const injectionScopeNames = this._grammarRepository.injections(scopeName);\n if (injectionScopeNames) {\n injectionScopeNames.forEach((injectionScopeName) => {\n const injectionGrammar = this.getExternalGrammar(injectionScopeName);\n if (injectionGrammar) {\n const selector = injectionGrammar.injectionSelector;\n if (selector) {\n collectInjections(result, selector, injectionGrammar, this, injectionGrammar);\n }\n }\n });\n }\n }\n result.sort((i1, i2) => i1.priority - i2.priority); // sort by priority\n return result;\n }\n getInjections() {\n if (this._injections === null) {\n this._injections = this._collectInjections();\n if (debug_1.DebugFlags.InDebugMode && this._injections.length > 0) {\n console.log(`Grammar ${this._rootScopeName} contains the following injections:`);\n for (const injection of this._injections) {\n console.log(` - ${injection.debugSelector}`);\n }\n }\n }\n return this._injections;\n }\n registerRule(factory) {\n const id = ++this._lastRuleId;\n const result = factory(rule_1.ruleIdFromNumber(id));\n this._ruleId2desc[id] = result;\n return result;\n }\n getRule(ruleId) {\n return this._ruleId2desc[rule_1.ruleIdToNumber(ruleId)];\n }\n getExternalGrammar(scopeName, repository) {\n if (this._includedGrammars[scopeName]) {\n return this._includedGrammars[scopeName];\n }\n else if (this._grammarRepository) {\n const rawIncludedGrammar = this._grammarRepository.lookup(scopeName);\n if (rawIncludedGrammar) {\n // console.log('LOADED GRAMMAR ' + pattern.include);\n this._includedGrammars[scopeName] = initGrammar(rawIncludedGrammar, repository && repository.$base);\n return this._includedGrammars[scopeName];\n }\n }\n return undefined;\n }\n tokenizeLine(lineText, prevState, timeLimit = 0) {\n const r = this._tokenize(lineText, prevState, false, timeLimit);\n return {\n tokens: r.lineTokens.getResult(r.ruleStack, r.lineLength),\n ruleStack: r.ruleStack,\n stoppedEarly: r.stoppedEarly,\n };\n }\n tokenizeLine2(lineText, prevState, timeLimit = 0) {\n const r = this._tokenize(lineText, prevState, true, timeLimit);\n return {\n tokens: r.lineTokens.getBinaryResult(r.ruleStack, r.lineLength),\n ruleStack: r.ruleStack,\n stoppedEarly: r.stoppedEarly,\n };\n }\n _tokenize(lineText, prevState, emitBinaryTokens, timeLimit) {\n if (this._rootId === -1) {\n this._rootId = rule_1.RuleFactory.getCompiledRuleId(this._grammar.repository.$self, this, this._grammar.repository);\n }\n let isFirstLine;\n if (!prevState || prevState === StateStack.NULL) {\n isFirstLine = true;\n const rawDefaultMetadata = this._basicScopeAttributesProvider.getDefaultAttributes();\n const defaultStyle = this.themeProvider.getDefaults();\n const defaultMetadata = encodedTokenAttributes_1.EncodedTokenAttributes.set(0, rawDefaultMetadata.languageId, rawDefaultMetadata.tokenType, null, defaultStyle.fontStyle, defaultStyle.foregroundId, defaultStyle.backgroundId);\n const rootScopeName = this.getRule(this._rootId).getName(null, null);\n let scopeList;\n if (rootScopeName) {\n scopeList = AttributedScopeStack.createRootAndLookUpScopeName(rootScopeName, defaultMetadata, this);\n }\n else {\n scopeList = AttributedScopeStack.createRoot(\"unknown\", defaultMetadata);\n }\n prevState = new StateStack(null, this._rootId, -1, -1, false, null, scopeList, scopeList);\n }\n else {\n isFirstLine = false;\n prevState.reset();\n }\n lineText = lineText + \"\\n\";\n const onigLineText = this.createOnigString(lineText);\n const lineLength = onigLineText.content.length;\n const lineTokens = new LineTokens(emitBinaryTokens, lineText, this._tokenTypeMatchers, this.balancedBracketSelectors);\n const r = tokenizeString_1._tokenizeString(this, onigLineText, isFirstLine, 0, prevState, lineTokens, true, timeLimit);\n onigLib_1.disposeOnigString(onigLineText);\n return {\n lineLength: lineLength,\n lineTokens: lineTokens,\n ruleStack: r.stack,\n stoppedEarly: r.stoppedEarly,\n };\n }\n}\nexports.Grammar = Grammar;\nfunction initGrammar(grammar, base) {\n grammar = utils_1.clone(grammar);\n grammar.repository = grammar.repository || {};\n grammar.repository.$self = {\n $vscodeTextmateLocation: grammar.$vscodeTextmateLocation,\n patterns: grammar.patterns,\n name: grammar.scopeName\n };\n grammar.repository.$base = base || grammar.repository.$self;\n return grammar;\n}\nclass AttributedScopeStack {\n constructor(parent, scopePath, tokenAttributes) {\n this.parent = parent;\n this.scopePath = scopePath;\n this.tokenAttributes = tokenAttributes;\n }\n static createRoot(scopeName, tokenAttributes) {\n return new AttributedScopeStack(null, new theme_1.ScopeStack(null, scopeName), tokenAttributes);\n }\n static createRootAndLookUpScopeName(scopeName, tokenAttributes, grammar) {\n const rawRootMetadata = grammar.getMetadataForScope(scopeName);\n const scopePath = new theme_1.ScopeStack(null, scopeName);\n const rootStyle = grammar.themeProvider.themeMatch(scopePath);\n const resolvedTokenAttributes = AttributedScopeStack.mergeAttributes(tokenAttributes, rawRootMetadata, rootStyle);\n return new AttributedScopeStack(null, scopePath, resolvedTokenAttributes);\n }\n get scopeName() { return this.scopePath.scopeName; }\n equals(other) {\n return AttributedScopeStack._equals(this, other);\n }\n static _equals(a, b) {\n do {\n if (a === b) {\n return true;\n }\n if (!a && !b) {\n // End of list reached for both\n return true;\n }\n if (!a || !b) {\n // End of list reached only for one\n return false;\n }\n if (a.scopeName !== b.scopeName || a.tokenAttributes !== b.tokenAttributes) {\n return false;\n }\n // Go to previous pair\n a = a.parent;\n b = b.parent;\n } while (true);\n }\n static mergeAttributes(existingTokenAttributes, basicScopeAttributes, styleAttributes) {\n let fontStyle = -1 /* NotSet */;\n let foreground = 0;\n let background = 0;\n if (styleAttributes !== null) {\n fontStyle = styleAttributes.fontStyle;\n foreground = styleAttributes.foregroundId;\n background = styleAttributes.backgroundId;\n }\n return encodedTokenAttributes_1.EncodedTokenAttributes.set(existingTokenAttributes, basicScopeAttributes.languageId, basicScopeAttributes.tokenType, null, fontStyle, foreground, background);\n }\n pushAttributed(scopePath, grammar) {\n if (scopePath === null) {\n return this;\n }\n if (scopePath.indexOf(' ') === -1) {\n // This is the common case and much faster\n return AttributedScopeStack._pushAttributed(this, scopePath, grammar);\n }\n const scopes = scopePath.split(/ /g);\n let result = this;\n for (const scope of scopes) {\n result = AttributedScopeStack._pushAttributed(result, scope, grammar);\n }\n return result;\n }\n static _pushAttributed(target, scopeName, grammar) {\n const rawMetadata = grammar.getMetadataForScope(scopeName);\n const newPath = target.scopePath.push(scopeName);\n const scopeThemeMatchResult = grammar.themeProvider.themeMatch(newPath);\n const metadata = AttributedScopeStack.mergeAttributes(target.tokenAttributes, rawMetadata, scopeThemeMatchResult);\n return new AttributedScopeStack(target, newPath, metadata);\n }\n getScopeNames() {\n return this.scopePath.getSegments();\n }\n}\nexports.AttributedScopeStack = AttributedScopeStack;\n/**\n * Represents a \"pushed\" state on the stack (as a linked list element).\n */\nclass StateStack {\n constructor(\n /**\n * The previous state on the stack (or null for the root state).\n */\n parent, \n /**\n * The state (rule) that this element represents.\n */\n ruleId, enterPos, anchorPos, \n /**\n * The state has entered and captured \\n. This means that the next line should have an anchorPosition of 0.\n */\n beginRuleCapturedEOL, \n /**\n * The \"pop\" (end) condition for this state in case that it was dynamically generated through captured text.\n */\n endRule, \n /**\n * The list of scopes containing the \"name\" for this state.\n */\n nameScopesList, \n /**\n * The list of scopes containing the \"contentName\" (besides \"name\") for this state.\n * This list **must** contain as an element `scopeName`.\n */\n contentNameScopesList) {\n this.parent = parent;\n this.ruleId = ruleId;\n this.beginRuleCapturedEOL = beginRuleCapturedEOL;\n this.endRule = endRule;\n this.nameScopesList = nameScopesList;\n this.contentNameScopesList = contentNameScopesList;\n this._stackElementBrand = undefined;\n this.depth = this.parent ? this.parent.depth + 1 : 1;\n this._enterPos = enterPos;\n this._anchorPos = anchorPos;\n }\n equals(other) {\n if (other === null) {\n return false;\n }\n return StateStack._equals(this, other);\n }\n static _equals(a, b) {\n if (a === b) {\n return true;\n }\n if (!this._structuralEquals(a, b)) {\n return false;\n }\n return a.contentNameScopesList.equals(b.contentNameScopesList);\n }\n /**\n * A structural equals check. Does not take into account `scopes`.\n */\n static _structuralEquals(a, b) {\n do {\n if (a === b) {\n return true;\n }\n if (!a && !b) {\n // End of list reached for both\n return true;\n }\n if (!a || !b) {\n // End of list reached only for one\n return false;\n }\n if (a.depth !== b.depth ||\n a.ruleId !== b.ruleId ||\n a.endRule !== b.endRule) {\n return false;\n }\n // Go to previous pair\n a = a.parent;\n b = b.parent;\n } while (true);\n }\n clone() {\n return this;\n }\n static _reset(el) {\n while (el) {\n el._enterPos = -1;\n el._anchorPos = -1;\n el = el.parent;\n }\n }\n reset() {\n StateStack._reset(this);\n }\n pop() {\n return this.parent;\n }\n safePop() {\n if (this.parent) {\n return this.parent;\n }\n return this;\n }\n push(ruleId, enterPos, anchorPos, beginRuleCapturedEOL, endRule, nameScopesList, contentNameScopesList) {\n return new StateStack(this, ruleId, enterPos, anchorPos, beginRuleCapturedEOL, endRule, nameScopesList, contentNameScopesList);\n }\n getEnterPos() {\n return this._enterPos;\n }\n getAnchorPos() {\n return this._anchorPos;\n }\n getRule(grammar) {\n return grammar.getRule(this.ruleId);\n }\n toString() {\n const r = [];\n this._writeString(r, 0);\n return \"[\" + r.join(\",\") + \"]\";\n }\n _writeString(res, outIndex) {\n if (this.parent) {\n outIndex = this.parent._writeString(res, outIndex);\n }\n res[outIndex++] = `(${this.ruleId}, TODO-${this.nameScopesList}, TODO-${this.contentNameScopesList})`;\n return outIndex;\n }\n withContentNameScopesList(contentNameScopeStack) {\n if (this.contentNameScopesList === contentNameScopeStack) {\n return this;\n }\n return this.parent.push(this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, this.endRule, this.nameScopesList, contentNameScopeStack);\n }\n withEndRule(endRule) {\n if (this.endRule === endRule) {\n return this;\n }\n return new StateStack(this.parent, this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, endRule, this.nameScopesList, this.contentNameScopesList);\n }\n // Used to warn of endless loops\n hasSameRuleAs(other) {\n let el = this;\n while (el && el._enterPos === other._enterPos) {\n if (el.ruleId === other.ruleId) {\n return true;\n }\n el = el.parent;\n }\n return false;\n }\n}\nexports.StateStack = StateStack;\n// TODO remove me\nStateStack.NULL = new StateStack(null, 0, 0, 0, false, null, null, null);\nclass BalancedBracketSelectors {\n constructor(balancedBracketScopes, unbalancedBracketScopes) {\n this.allowAny = false;\n this.balancedBracketScopes = balancedBracketScopes.flatMap((selector) => {\n if (selector === '*') {\n this.allowAny = true;\n return [];\n }\n return matcher_1.createMatchers(selector, nameMatcher).map((m) => m.matcher);\n });\n this.unbalancedBracketScopes = unbalancedBracketScopes.flatMap((selector) => matcher_1.createMatchers(selector, nameMatcher).map((m) => m.matcher));\n }\n get matchesAlways() {\n return this.allowAny && this.unbalancedBracketScopes.length === 0;\n }\n get matchesNever() {\n return this.balancedBracketScopes.length === 0 && !this.allowAny;\n }\n match(scopes) {\n for (const excluder of this.unbalancedBracketScopes) {\n if (excluder(scopes)) {\n return false;\n }\n }\n for (const includer of this.balancedBracketScopes) {\n if (includer(scopes)) {\n return true;\n }\n }\n return this.allowAny;\n }\n}\nexports.BalancedBracketSelectors = BalancedBracketSelectors;\nclass LineTokens {\n constructor(emitBinaryTokens, lineText, tokenTypeOverrides, balancedBracketSelectors) {\n this.balancedBracketSelectors = balancedBracketSelectors;\n this._emitBinaryTokens = emitBinaryTokens;\n this._tokenTypeOverrides = tokenTypeOverrides;\n if (debug_1.DebugFlags.InDebugMode) {\n this._lineText = lineText;\n }\n else {\n this._lineText = null;\n }\n this._tokens = [];\n this._binaryTokens = [];\n this._lastTokenEndIndex = 0;\n }\n produce(stack, endIndex) {\n this.produceFromScopes(stack.contentNameScopesList, endIndex);\n }\n produceFromScopes(scopesList, endIndex) {\n if (this._lastTokenEndIndex >= endIndex) {\n return;\n }\n if (this._emitBinaryTokens) {\n let metadata = scopesList.tokenAttributes;\n let containsBalancedBrackets = false;\n if (this.balancedBracketSelectors?.matchesAlways) {\n containsBalancedBrackets = true;\n }\n if (this._tokenTypeOverrides.length > 0 || (this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever)) {\n // Only generate scope array when required to improve performance\n const scopes = scopesList.getScopeNames();\n for (const tokenType of this._tokenTypeOverrides) {\n if (tokenType.matcher(scopes)) {\n metadata = encodedTokenAttributes_1.EncodedTokenAttributes.set(metadata, 0, encodedTokenAttributes_1.toOptionalTokenType(tokenType.type), null, -1 /* NotSet */, 0, 0);\n }\n }\n if (this.balancedBracketSelectors) {\n containsBalancedBrackets = this.balancedBracketSelectors.match(scopes);\n }\n }\n if (containsBalancedBrackets) {\n metadata = encodedTokenAttributes_1.EncodedTokenAttributes.set(metadata, 0, 8 /* NotSet */, containsBalancedBrackets, -1 /* NotSet */, 0, 0);\n }\n if (this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === metadata) {\n // no need to push a token with the same metadata\n this._lastTokenEndIndex = endIndex;\n return;\n }\n if (debug_1.DebugFlags.InDebugMode) {\n const scopes = scopesList.getScopeNames();\n console.log(' token: |' + this._lineText.substring(this._lastTokenEndIndex, endIndex).replace(/\\n$/, '\\\\n') + '|');\n for (let k = 0; k < scopes.length; k++) {\n console.log(' * ' + scopes[k]);\n }\n }\n this._binaryTokens.push(this._lastTokenEndIndex);\n this._binaryTokens.push(metadata);\n this._lastTokenEndIndex = endIndex;\n return;\n }\n const scopes = scopesList.getScopeNames();\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(' token: |' + this._lineText.substring(this._lastTokenEndIndex, endIndex).replace(/\\n$/, '\\\\n') + '|');\n for (let k = 0; k < scopes.length; k++) {\n console.log(' * ' + scopes[k]);\n }\n }\n this._tokens.push({\n startIndex: this._lastTokenEndIndex,\n endIndex: endIndex,\n // value: lineText.substring(lastTokenEndIndex, endIndex),\n scopes: scopes\n });\n this._lastTokenEndIndex = endIndex;\n }\n getResult(stack, lineLength) {\n if (this._tokens.length > 0 && this._tokens[this._tokens.length - 1].startIndex === lineLength - 1) {\n // pop produced token for newline\n this._tokens.pop();\n }\n if (this._tokens.length === 0) {\n this._lastTokenEndIndex = -1;\n this.produce(stack, lineLength);\n this._tokens[this._tokens.length - 1].startIndex = 0;\n }\n return this._tokens;\n }\n getBinaryResult(stack, lineLength) {\n if (this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 2] === lineLength - 1) {\n // pop produced token for newline\n this._binaryTokens.pop();\n this._binaryTokens.pop();\n }\n if (this._binaryTokens.length === 0) {\n this._lastTokenEndIndex = -1;\n this.produce(stack, lineLength);\n this._binaryTokens[this._binaryTokens.length - 2] = 0;\n }\n const result = new Uint32Array(this._binaryTokens.length);\n for (let i = 0, len = this._binaryTokens.length; i < len; i++) {\n result[i] = this._binaryTokens[i];\n }\n return result;\n }\n}\nexports.LineTokens = LineTokens;\n//# sourceMappingURL=grammar.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseInclude = exports.TopLevelRepositoryReference = exports.TopLevelReference = exports.RelativeReference = exports.SelfReference = exports.BaseReference = exports.ScopeDependencyProcessor = exports.ExternalReferenceCollector = exports.TopLevelRepositoryRuleReference = exports.TopLevelRuleReference = void 0;\nconst utils_1 = require(\"../utils\");\n/**\n * References the top level rule of a grammar with the given scope name.\n*/\nclass TopLevelRuleReference {\n constructor(scopeName) {\n this.scopeName = scopeName;\n }\n toKey() {\n return this.scopeName;\n }\n}\nexports.TopLevelRuleReference = TopLevelRuleReference;\n/**\n * References a rule of a grammar in the top level repository section with the given name.\n*/\nclass TopLevelRepositoryRuleReference {\n constructor(scopeName, ruleName) {\n this.scopeName = scopeName;\n this.ruleName = ruleName;\n }\n toKey() {\n return `${this.scopeName}#${this.ruleName}`;\n }\n}\nexports.TopLevelRepositoryRuleReference = TopLevelRepositoryRuleReference;\nclass ExternalReferenceCollector {\n constructor() {\n this._references = [];\n this._seenReferenceKeys = new Set();\n this.visitedRule = new Set();\n }\n get references() {\n return this._references;\n }\n add(reference) {\n const key = reference.toKey();\n if (this._seenReferenceKeys.has(key)) {\n return;\n }\n this._seenReferenceKeys.add(key);\n this._references.push(reference);\n }\n}\nexports.ExternalReferenceCollector = ExternalReferenceCollector;\nclass ScopeDependencyProcessor {\n constructor(repo, initialScopeName) {\n this.repo = repo;\n this.initialScopeName = initialScopeName;\n this.seenFullScopeRequests = new Set();\n this.seenPartialScopeRequests = new Set();\n this.seenFullScopeRequests.add(this.initialScopeName);\n this.Q = [new TopLevelRuleReference(this.initialScopeName)];\n }\n processQueue() {\n const q = this.Q;\n this.Q = [];\n const deps = new ExternalReferenceCollector();\n for (const dep of q) {\n collectReferencesOfReference(dep, this.initialScopeName, this.repo, deps);\n }\n for (const dep of deps.references) {\n if (dep instanceof TopLevelRuleReference) {\n if (this.seenFullScopeRequests.has(dep.scopeName)) {\n // already processed\n continue;\n }\n this.seenFullScopeRequests.add(dep.scopeName);\n this.Q.push(dep);\n }\n else {\n if (this.seenFullScopeRequests.has(dep.scopeName)) {\n // already processed in full\n continue;\n }\n if (this.seenPartialScopeRequests.has(dep.toKey())) {\n // already processed\n continue;\n }\n this.seenPartialScopeRequests.add(dep.toKey());\n this.Q.push(dep);\n }\n }\n }\n}\nexports.ScopeDependencyProcessor = ScopeDependencyProcessor;\nfunction collectReferencesOfReference(reference, baseGrammarScopeName, repo, result) {\n const selfGrammar = repo.lookup(reference.scopeName);\n if (!selfGrammar) {\n if (reference.scopeName === baseGrammarScopeName) {\n throw new Error(`No grammar provided for <${baseGrammarScopeName}>`);\n }\n return;\n }\n const baseGrammar = repo.lookup(baseGrammarScopeName);\n if (reference instanceof TopLevelRuleReference) {\n collectExternalReferencesInTopLevelRule({ baseGrammar, selfGrammar }, result);\n }\n else {\n collectExternalReferencesInTopLevelRepositoryRule(reference.ruleName, { baseGrammar, selfGrammar, repository: selfGrammar.repository }, result);\n }\n const injections = repo.injections(reference.scopeName);\n if (injections) {\n for (const injection of injections) {\n result.add(new TopLevelRuleReference(injection));\n }\n }\n}\nfunction collectExternalReferencesInTopLevelRepositoryRule(ruleName, context, result) {\n if (context.repository && context.repository[ruleName]) {\n const rule = context.repository[ruleName];\n collectExternalReferencesInRules([rule], context, result);\n }\n}\nfunction collectExternalReferencesInTopLevelRule(context, result) {\n if (context.selfGrammar.patterns && Array.isArray(context.selfGrammar.patterns)) {\n collectExternalReferencesInRules(context.selfGrammar.patterns, { ...context, repository: context.selfGrammar.repository }, result);\n }\n if (context.selfGrammar.injections) {\n collectExternalReferencesInRules(Object.values(context.selfGrammar.injections), { ...context, repository: context.selfGrammar.repository }, result);\n }\n}\nfunction collectExternalReferencesInRules(rules, context, result) {\n for (const rule of rules) {\n if (result.visitedRule.has(rule)) {\n continue;\n }\n result.visitedRule.add(rule);\n const patternRepository = rule.repository ? utils_1.mergeObjects({}, context.repository, rule.repository) : context.repository;\n if (Array.isArray(rule.patterns)) {\n collectExternalReferencesInRules(rule.patterns, { ...context, repository: patternRepository }, result);\n }\n const include = rule.include;\n if (!include) {\n continue;\n }\n const reference = parseInclude(include);\n switch (reference.kind) {\n case 0 /* Base */:\n collectExternalReferencesInTopLevelRule({ ...context, selfGrammar: context.baseGrammar }, result);\n break;\n case 1 /* Self */:\n collectExternalReferencesInTopLevelRule(context, result);\n break;\n case 2 /* RelativeReference */:\n collectExternalReferencesInTopLevelRepositoryRule(reference.ruleName, { ...context, repository: patternRepository }, result);\n break;\n case 3 /* TopLevelReference */:\n case 4 /* TopLevelRepositoryReference */:\n const selfGrammar = reference.scopeName === context.selfGrammar.scopeName\n ? context.selfGrammar\n : reference.scopeName === context.baseGrammar.scopeName\n ? context.baseGrammar\n : undefined;\n if (selfGrammar) {\n const newContext = { baseGrammar: context.baseGrammar, selfGrammar, repository: patternRepository };\n if (reference.kind === 4 /* TopLevelRepositoryReference */) {\n collectExternalReferencesInTopLevelRepositoryRule(reference.ruleName, newContext, result);\n }\n else {\n collectExternalReferencesInTopLevelRule(newContext, result);\n }\n }\n else {\n if (reference.kind === 4 /* TopLevelRepositoryReference */) {\n result.add(new TopLevelRepositoryRuleReference(reference.scopeName, reference.ruleName));\n }\n else {\n result.add(new TopLevelRuleReference(reference.scopeName));\n }\n }\n break;\n }\n }\n}\nclass BaseReference {\n constructor() {\n this.kind = 0 /* Base */;\n }\n}\nexports.BaseReference = BaseReference;\nclass SelfReference {\n constructor() {\n this.kind = 1 /* Self */;\n }\n}\nexports.SelfReference = SelfReference;\nclass RelativeReference {\n constructor(ruleName) {\n this.ruleName = ruleName;\n this.kind = 2 /* RelativeReference */;\n }\n}\nexports.RelativeReference = RelativeReference;\nclass TopLevelReference {\n constructor(scopeName) {\n this.scopeName = scopeName;\n this.kind = 3 /* TopLevelReference */;\n }\n}\nexports.TopLevelReference = TopLevelReference;\nclass TopLevelRepositoryReference {\n constructor(scopeName, ruleName) {\n this.scopeName = scopeName;\n this.ruleName = ruleName;\n this.kind = 4 /* TopLevelRepositoryReference */;\n }\n}\nexports.TopLevelRepositoryReference = TopLevelRepositoryReference;\nfunction parseInclude(include) {\n if (include === '$base') {\n return new BaseReference();\n }\n else if (include === '$self') {\n return new SelfReference();\n }\n const indexOfSharp = include.indexOf(\"#\");\n if (indexOfSharp === -1) {\n return new TopLevelReference(include);\n }\n else if (indexOfSharp === 0) {\n return new RelativeReference(include.substring(1));\n }\n else {\n const scopeName = include.substring(0, indexOfSharp);\n const ruleName = include.substring(indexOfSharp + 1);\n return new TopLevelRepositoryReference(scopeName, ruleName);\n }\n}\nexports.parseInclude = parseInclude;\n//# sourceMappingURL=grammarDependencies.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./grammar\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LocalStackElement = exports._tokenizeString = void 0;\nconst debug_1 = require(\"../debug\");\nconst onigLib_1 = require(\"../onigLib\");\nconst rule_1 = require(\"../rule\");\nconst utils_1 = require(\"../utils\");\nclass TokenizeStringResult {\n constructor(stack, stoppedEarly) {\n this.stack = stack;\n this.stoppedEarly = stoppedEarly;\n }\n}\n/**\n * Tokenize a string\n * @param grammar\n * @param lineText\n * @param isFirstLine\n * @param linePos\n * @param stack\n * @param lineTokens\n * @param checkWhileConditions\n * @param timeLimit Use `0` to indicate no time limit\n * @returns the StackElement or StackElement.TIME_LIMIT_REACHED if the time limit has been reached\n */\nfunction _tokenizeString(grammar, lineText, isFirstLine, linePos, stack, lineTokens, checkWhileConditions, timeLimit) {\n const lineLength = lineText.content.length;\n let STOP = false;\n let anchorPosition = -1;\n if (checkWhileConditions) {\n const whileCheckResult = _checkWhileConditions(grammar, lineText, isFirstLine, linePos, stack, lineTokens);\n stack = whileCheckResult.stack;\n linePos = whileCheckResult.linePos;\n isFirstLine = whileCheckResult.isFirstLine;\n anchorPosition = whileCheckResult.anchorPosition;\n }\n const startTime = Date.now();\n while (!STOP) {\n if (timeLimit !== 0) {\n const elapsedTime = Date.now() - startTime;\n if (elapsedTime > timeLimit) {\n return new TokenizeStringResult(stack, true);\n }\n }\n scanNext(); // potentially modifies linePos && anchorPosition\n }\n return new TokenizeStringResult(stack, false);\n function scanNext() {\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\"\");\n console.log(`@@scanNext ${linePos}: |${lineText.content\n .substr(linePos)\n .replace(/\\n$/, \"\\\\n\")}|`);\n }\n const r = matchRuleOrInjections(grammar, lineText, isFirstLine, linePos, stack, anchorPosition);\n if (!r) {\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\" no more matches.\");\n }\n // No match\n lineTokens.produce(stack, lineLength);\n STOP = true;\n return;\n }\n const captureIndices = r.captureIndices;\n const matchedRuleId = r.matchedRuleId;\n const hasAdvanced = captureIndices && captureIndices.length > 0\n ? captureIndices[0].end > linePos\n : false;\n if (matchedRuleId === rule_1.endRuleId) {\n // We matched the `end` for this rule => pop it\n const poppedRule = stack.getRule(grammar);\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\" popping \" +\n poppedRule.debugName +\n \" - \" +\n poppedRule.debugEndRegExp);\n }\n lineTokens.produce(stack, captureIndices[0].start);\n stack = stack.withContentNameScopesList(stack.nameScopesList);\n handleCaptures(grammar, lineText, isFirstLine, stack, lineTokens, poppedRule.endCaptures, captureIndices);\n lineTokens.produce(stack, captureIndices[0].end);\n // pop\n const popped = stack;\n stack = stack.parent;\n anchorPosition = popped.getAnchorPos();\n if (!hasAdvanced && popped.getEnterPos() === linePos) {\n // Grammar pushed & popped a rule without advancing\n if (debug_1.DebugFlags.InDebugMode) {\n console.error(\"[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing\");\n }\n // See https://github.com/Microsoft/vscode-textmate/issues/12\n // Let's assume this was a mistake by the grammar author and the intent was to continue in this state\n stack = popped;\n lineTokens.produce(stack, lineLength);\n STOP = true;\n return;\n }\n }\n else {\n // We matched a rule!\n const _rule = grammar.getRule(matchedRuleId);\n lineTokens.produce(stack, captureIndices[0].start);\n const beforePush = stack;\n // push it on the stack rule\n const scopeName = _rule.getName(lineText.content, captureIndices);\n const nameScopesList = stack.contentNameScopesList.pushAttributed(scopeName, grammar);\n stack = stack.push(matchedRuleId, linePos, anchorPosition, captureIndices[0].end === lineLength, null, nameScopesList, nameScopesList);\n if (_rule instanceof rule_1.BeginEndRule) {\n const pushedRule = _rule;\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\" pushing \" +\n pushedRule.debugName +\n \" - \" +\n pushedRule.debugBeginRegExp);\n }\n handleCaptures(grammar, lineText, isFirstLine, stack, lineTokens, pushedRule.beginCaptures, captureIndices);\n lineTokens.produce(stack, captureIndices[0].end);\n anchorPosition = captureIndices[0].end;\n const contentName = pushedRule.getContentName(lineText.content, captureIndices);\n const contentNameScopesList = nameScopesList.pushAttributed(contentName, grammar);\n stack = stack.withContentNameScopesList(contentNameScopesList);\n if (pushedRule.endHasBackReferences) {\n stack = stack.withEndRule(pushedRule.getEndWithResolvedBackReferences(lineText.content, captureIndices));\n }\n if (!hasAdvanced && beforePush.hasSameRuleAs(stack)) {\n // Grammar pushed the same rule without advancing\n if (debug_1.DebugFlags.InDebugMode) {\n console.error(\"[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing\");\n }\n stack = stack.pop();\n lineTokens.produce(stack, lineLength);\n STOP = true;\n return;\n }\n }\n else if (_rule instanceof rule_1.BeginWhileRule) {\n const pushedRule = _rule;\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\" pushing \" + pushedRule.debugName);\n }\n handleCaptures(grammar, lineText, isFirstLine, stack, lineTokens, pushedRule.beginCaptures, captureIndices);\n lineTokens.produce(stack, captureIndices[0].end);\n anchorPosition = captureIndices[0].end;\n const contentName = pushedRule.getContentName(lineText.content, captureIndices);\n const contentNameScopesList = nameScopesList.pushAttributed(contentName, grammar);\n stack = stack.withContentNameScopesList(contentNameScopesList);\n if (pushedRule.whileHasBackReferences) {\n stack = stack.withEndRule(pushedRule.getWhileWithResolvedBackReferences(lineText.content, captureIndices));\n }\n if (!hasAdvanced && beforePush.hasSameRuleAs(stack)) {\n // Grammar pushed the same rule without advancing\n if (debug_1.DebugFlags.InDebugMode) {\n console.error(\"[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing\");\n }\n stack = stack.pop();\n lineTokens.produce(stack, lineLength);\n STOP = true;\n return;\n }\n }\n else {\n const matchingRule = _rule;\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(\" matched \" +\n matchingRule.debugName +\n \" - \" +\n matchingRule.debugMatchRegExp);\n }\n handleCaptures(grammar, lineText, isFirstLine, stack, lineTokens, matchingRule.captures, captureIndices);\n lineTokens.produce(stack, captureIndices[0].end);\n // pop rule immediately since it is a MatchRule\n stack = stack.pop();\n if (!hasAdvanced) {\n // Grammar is not advancing, nor is it pushing/popping\n if (debug_1.DebugFlags.InDebugMode) {\n console.error(\"[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping\");\n }\n stack = stack.safePop();\n lineTokens.produce(stack, lineLength);\n STOP = true;\n return;\n }\n }\n }\n if (captureIndices[0].end > linePos) {\n // Advance stream\n linePos = captureIndices[0].end;\n isFirstLine = false;\n }\n }\n}\nexports._tokenizeString = _tokenizeString;\n/**\n * Walk the stack from bottom to top, and check each while condition in this order.\n * If any fails, cut off the entire stack above the failed while condition. While conditions\n * may also advance the linePosition.\n */\nfunction _checkWhileConditions(grammar, lineText, isFirstLine, linePos, stack, lineTokens) {\n let anchorPosition = (stack.beginRuleCapturedEOL ? 0 : -1);\n const whileRules = [];\n for (let node = stack; node; node = node.pop()) {\n const nodeRule = node.getRule(grammar);\n if (nodeRule instanceof rule_1.BeginWhileRule) {\n whileRules.push({\n rule: nodeRule,\n stack: node\n });\n }\n }\n for (let whileRule = whileRules.pop(); whileRule; whileRule = whileRules.pop()) {\n const { ruleScanner, findOptions } = prepareRuleWhileSearch(whileRule.rule, grammar, whileRule.stack.endRule, isFirstLine, linePos === anchorPosition);\n const r = ruleScanner.findNextMatchSync(lineText, linePos, findOptions);\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(' scanning for while rule');\n console.log(ruleScanner.toString());\n }\n if (r) {\n const matchedRuleId = r.ruleId;\n if (matchedRuleId !== rule_1.whileRuleId) {\n // we shouldn't end up here\n stack = whileRule.stack.pop();\n break;\n }\n if (r.captureIndices && r.captureIndices.length) {\n lineTokens.produce(whileRule.stack, r.captureIndices[0].start);\n handleCaptures(grammar, lineText, isFirstLine, whileRule.stack, lineTokens, whileRule.rule.whileCaptures, r.captureIndices);\n lineTokens.produce(whileRule.stack, r.captureIndices[0].end);\n anchorPosition = r.captureIndices[0].end;\n if (r.captureIndices[0].end > linePos) {\n linePos = r.captureIndices[0].end;\n isFirstLine = false;\n }\n }\n }\n else {\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(' popping ' + whileRule.rule.debugName + ' - ' + whileRule.rule.debugWhileRegExp);\n }\n stack = whileRule.stack.pop();\n break;\n }\n }\n return { stack: stack, linePos: linePos, anchorPosition: anchorPosition, isFirstLine: isFirstLine };\n}\nfunction matchRuleOrInjections(grammar, lineText, isFirstLine, linePos, stack, anchorPosition) {\n // Look for normal grammar rule\n const matchResult = matchRule(grammar, lineText, isFirstLine, linePos, stack, anchorPosition);\n // Look for injected rules\n const injections = grammar.getInjections();\n if (injections.length === 0) {\n // No injections whatsoever => early return\n return matchResult;\n }\n const injectionResult = matchInjections(injections, grammar, lineText, isFirstLine, linePos, stack, anchorPosition);\n if (!injectionResult) {\n // No injections matched => early return\n return matchResult;\n }\n if (!matchResult) {\n // Only injections matched => early return\n return injectionResult;\n }\n // Decide if `matchResult` or `injectionResult` should win\n const matchResultScore = matchResult.captureIndices[0].start;\n const injectionResultScore = injectionResult.captureIndices[0].start;\n if (injectionResultScore < matchResultScore || (injectionResult.priorityMatch && injectionResultScore === matchResultScore)) {\n // injection won!\n return injectionResult;\n }\n return matchResult;\n}\nfunction matchRule(grammar, lineText, isFirstLine, linePos, stack, anchorPosition) {\n const rule = stack.getRule(grammar);\n const { ruleScanner, findOptions } = prepareRuleSearch(rule, grammar, stack.endRule, isFirstLine, linePos === anchorPosition);\n let perfStart = 0;\n if (debug_1.DebugFlags.InDebugMode) {\n perfStart = utils_1.performanceNow();\n }\n const r = ruleScanner.findNextMatchSync(lineText, linePos, findOptions);\n if (debug_1.DebugFlags.InDebugMode) {\n const elapsedMillis = utils_1.performanceNow() - perfStart;\n if (elapsedMillis > 5) {\n console.warn(`Rule ${rule.debugName} (${rule.id}) matching took ${elapsedMillis} against '${lineText}'`);\n }\n console.log(` scanning for (linePos: ${linePos}, anchorPosition: ${anchorPosition})`);\n console.log(ruleScanner.toString());\n if (r) {\n console.log(`matched rule id: ${r.ruleId} from ${r.captureIndices[0].start} to ${r.captureIndices[0].end}`);\n }\n }\n if (r) {\n return {\n captureIndices: r.captureIndices,\n matchedRuleId: r.ruleId\n };\n }\n return null;\n}\nfunction matchInjections(injections, grammar, lineText, isFirstLine, linePos, stack, anchorPosition) {\n // The lower the better\n let bestMatchRating = Number.MAX_VALUE;\n let bestMatchCaptureIndices = null;\n let bestMatchRuleId;\n let bestMatchResultPriority = 0;\n const scopes = stack.contentNameScopesList.getScopeNames();\n for (let i = 0, len = injections.length; i < len; i++) {\n const injection = injections[i];\n if (!injection.matcher(scopes)) {\n // injection selector doesn't match stack\n continue;\n }\n const rule = grammar.getRule(injection.ruleId);\n const { ruleScanner, findOptions } = prepareRuleSearch(rule, grammar, null, isFirstLine, linePos === anchorPosition);\n const matchResult = ruleScanner.findNextMatchSync(lineText, linePos, findOptions);\n if (!matchResult) {\n continue;\n }\n if (debug_1.DebugFlags.InDebugMode) {\n console.log(` matched injection: ${injection.debugSelector}`);\n console.log(ruleScanner.toString());\n }\n const matchRating = matchResult.captureIndices[0].start;\n if (matchRating >= bestMatchRating) {\n // Injections are sorted by priority, so the previous injection had a better or equal priority\n continue;\n }\n bestMatchRating = matchRating;\n bestMatchCaptureIndices = matchResult.captureIndices;\n bestMatchRuleId = matchResult.ruleId;\n bestMatchResultPriority = injection.priority;\n if (bestMatchRating === linePos) {\n // No more need to look at the rest of the injections.\n break;\n }\n }\n if (bestMatchCaptureIndices) {\n return {\n priorityMatch: bestMatchResultPriority === -1,\n captureIndices: bestMatchCaptureIndices,\n matchedRuleId: bestMatchRuleId\n };\n }\n return null;\n}\nfunction prepareRuleSearch(rule, grammar, endRegexSource, allowA, allowG) {\n if (debug_1.UseOnigurumaFindOptions) {\n const ruleScanner = rule.compile(grammar, endRegexSource);\n const findOptions = getFindOptions(allowA, allowG);\n return { ruleScanner, findOptions };\n }\n const ruleScanner = rule.compileAG(grammar, endRegexSource, allowA, allowG);\n return { ruleScanner, findOptions: 0 /* None */ };\n}\nfunction prepareRuleWhileSearch(rule, grammar, endRegexSource, allowA, allowG) {\n if (debug_1.UseOnigurumaFindOptions) {\n const ruleScanner = rule.compileWhile(grammar, endRegexSource);\n const findOptions = getFindOptions(allowA, allowG);\n return { ruleScanner, findOptions };\n }\n const ruleScanner = rule.compileWhileAG(grammar, endRegexSource, allowA, allowG);\n return { ruleScanner, findOptions: 0 /* None */ };\n}\nfunction getFindOptions(allowA, allowG) {\n let options = 0 /* None */;\n if (!allowA) {\n options |= 1 /* NotBeginString */;\n }\n if (!allowG) {\n options |= 4 /* NotBeginPosition */;\n }\n return options;\n}\nfunction handleCaptures(grammar, lineText, isFirstLine, stack, lineTokens, captures, captureIndices) {\n if (captures.length === 0) {\n return;\n }\n const lineTextContent = lineText.content;\n const len = Math.min(captures.length, captureIndices.length);\n const localStack = [];\n const maxEnd = captureIndices[0].end;\n for (let i = 0; i < len; i++) {\n const captureRule = captures[i];\n if (captureRule === null) {\n // Not interested\n continue;\n }\n const captureIndex = captureIndices[i];\n if (captureIndex.length === 0) {\n // Nothing really captured\n continue;\n }\n if (captureIndex.start > maxEnd) {\n // Capture going beyond consumed string\n break;\n }\n // pop captures while needed\n while (localStack.length > 0 && localStack[localStack.length - 1].endPos <= captureIndex.start) {\n // pop!\n lineTokens.produceFromScopes(localStack[localStack.length - 1].scopes, localStack[localStack.length - 1].endPos);\n localStack.pop();\n }\n if (localStack.length > 0) {\n lineTokens.produceFromScopes(localStack[localStack.length - 1].scopes, captureIndex.start);\n }\n else {\n lineTokens.produce(stack, captureIndex.start);\n }\n if (captureRule.retokenizeCapturedWithRuleId) {\n // the capture requires additional matching\n const scopeName = captureRule.getName(lineTextContent, captureIndices);\n const nameScopesList = stack.contentNameScopesList.pushAttributed(scopeName, grammar);\n const contentName = captureRule.getContentName(lineTextContent, captureIndices);\n const contentNameScopesList = nameScopesList.pushAttributed(contentName, grammar);\n const stackClone = stack.push(captureRule.retokenizeCapturedWithRuleId, captureIndex.start, -1, false, null, nameScopesList, contentNameScopesList);\n const onigSubStr = grammar.createOnigString(lineTextContent.substring(0, captureIndex.end));\n _tokenizeString(grammar, onigSubStr, (isFirstLine && captureIndex.start === 0), captureIndex.start, stackClone, lineTokens, false, /* no time limit */ 0);\n onigLib_1.disposeOnigString(onigSubStr);\n continue;\n }\n const captureRuleScopeName = captureRule.getName(lineTextContent, captureIndices);\n if (captureRuleScopeName !== null) {\n // push\n const base = localStack.length > 0 ? localStack[localStack.length - 1].scopes : stack.contentNameScopesList;\n const captureRuleScopesList = base.pushAttributed(captureRuleScopeName, grammar);\n localStack.push(new LocalStackElement(captureRuleScopesList, captureIndex.end));\n }\n }\n while (localStack.length > 0) {\n // pop!\n lineTokens.produceFromScopes(localStack[localStack.length - 1].scopes, localStack[localStack.length - 1].endPos);\n localStack.pop();\n }\n}\nclass LocalStackElement {\n constructor(scopes, endPos) {\n this.scopes = scopes;\n this.endPos = endPos;\n }\n}\nexports.LocalStackElement = LocalStackElement;\n//# sourceMappingURL=tokenizeString.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseJSON = void 0;\nfunction doFail(streamState, msg) {\n // console.log('Near offset ' + streamState.pos + ': ' + msg + ' ~~~' + streamState.source.substr(streamState.pos, 50) + '~~~');\n throw new Error('Near offset ' + streamState.pos + ': ' + msg + ' ~~~' + streamState.source.substr(streamState.pos, 50) + '~~~');\n}\nfunction parseJSON(source, filename, withMetadata) {\n let streamState = new JSONStreamState(source);\n let token = new JSONToken();\n let state = 0 /* ROOT_STATE */;\n let cur = null;\n let stateStack = [];\n let objStack = [];\n function pushState() {\n stateStack.push(state);\n objStack.push(cur);\n }\n function popState() {\n state = stateStack.pop();\n cur = objStack.pop();\n }\n function fail(msg) {\n doFail(streamState, msg);\n }\n while (nextJSONToken(streamState, token)) {\n if (state === 0 /* ROOT_STATE */) {\n if (cur !== null) {\n fail('too many constructs in root');\n }\n if (token.type === 3 /* LEFT_CURLY_BRACKET */) {\n cur = {};\n if (withMetadata) {\n cur.$vscodeTextmateLocation = token.toLocation(filename);\n }\n pushState();\n state = 1 /* DICT_STATE */;\n continue;\n }\n if (token.type === 2 /* LEFT_SQUARE_BRACKET */) {\n cur = [];\n pushState();\n state = 4 /* ARR_STATE */;\n continue;\n }\n fail('unexpected token in root');\n }\n if (state === 2 /* DICT_STATE_COMMA */) {\n if (token.type === 5 /* RIGHT_CURLY_BRACKET */) {\n popState();\n continue;\n }\n if (token.type === 7 /* COMMA */) {\n state = 3 /* DICT_STATE_NO_CLOSE */;\n continue;\n }\n fail('expected , or }');\n }\n if (state === 1 /* DICT_STATE */ || state === 3 /* DICT_STATE_NO_CLOSE */) {\n if (state === 1 /* DICT_STATE */ && token.type === 5 /* RIGHT_CURLY_BRACKET */) {\n popState();\n continue;\n }\n if (token.type === 1 /* STRING */) {\n let keyValue = token.value;\n if (!nextJSONToken(streamState, token) || token.type !== 6 /* COLON */) {\n fail('expected colon');\n }\n if (!nextJSONToken(streamState, token)) {\n fail('expected value');\n }\n state = 2 /* DICT_STATE_COMMA */;\n if (token.type === 1 /* STRING */) {\n cur[keyValue] = token.value;\n continue;\n }\n if (token.type === 8 /* NULL */) {\n cur[keyValue] = null;\n continue;\n }\n if (token.type === 9 /* TRUE */) {\n cur[keyValue] = true;\n continue;\n }\n if (token.type === 10 /* FALSE */) {\n cur[keyValue] = false;\n continue;\n }\n if (token.type === 11 /* NUMBER */) {\n cur[keyValue] = parseFloat(token.value);\n continue;\n }\n if (token.type === 2 /* LEFT_SQUARE_BRACKET */) {\n let newArr = [];\n cur[keyValue] = newArr;\n pushState();\n state = 4 /* ARR_STATE */;\n cur = newArr;\n continue;\n }\n if (token.type === 3 /* LEFT_CURLY_BRACKET */) {\n let newDict = {};\n if (withMetadata) {\n newDict.$vscodeTextmateLocation = token.toLocation(filename);\n }\n cur[keyValue] = newDict;\n pushState();\n state = 1 /* DICT_STATE */;\n cur = newDict;\n continue;\n }\n }\n fail('unexpected token in dict');\n }\n if (state === 5 /* ARR_STATE_COMMA */) {\n if (token.type === 4 /* RIGHT_SQUARE_BRACKET */) {\n popState();\n continue;\n }\n if (token.type === 7 /* COMMA */) {\n state = 6 /* ARR_STATE_NO_CLOSE */;\n continue;\n }\n fail('expected , or ]');\n }\n if (state === 4 /* ARR_STATE */ || state === 6 /* ARR_STATE_NO_CLOSE */) {\n if (state === 4 /* ARR_STATE */ && token.type === 4 /* RIGHT_SQUARE_BRACKET */) {\n popState();\n continue;\n }\n state = 5 /* ARR_STATE_COMMA */;\n if (token.type === 1 /* STRING */) {\n cur.push(token.value);\n continue;\n }\n if (token.type === 8 /* NULL */) {\n cur.push(null);\n continue;\n }\n if (token.type === 9 /* TRUE */) {\n cur.push(true);\n continue;\n }\n if (token.type === 10 /* FALSE */) {\n cur.push(false);\n continue;\n }\n if (token.type === 11 /* NUMBER */) {\n cur.push(parseFloat(token.value));\n continue;\n }\n if (token.type === 2 /* LEFT_SQUARE_BRACKET */) {\n let newArr = [];\n cur.push(newArr);\n pushState();\n state = 4 /* ARR_STATE */;\n cur = newArr;\n continue;\n }\n if (token.type === 3 /* LEFT_CURLY_BRACKET */) {\n let newDict = {};\n if (withMetadata) {\n newDict.$vscodeTextmateLocation = token.toLocation(filename);\n }\n cur.push(newDict);\n pushState();\n state = 1 /* DICT_STATE */;\n cur = newDict;\n continue;\n }\n fail('unexpected token in array');\n }\n fail('unknown state');\n }\n if (objStack.length !== 0) {\n fail('unclosed constructs');\n }\n return cur;\n}\nexports.parseJSON = parseJSON;\nclass JSONStreamState {\n constructor(source) {\n this.source = source;\n this.pos = 0;\n this.len = source.length;\n this.line = 1;\n this.char = 0;\n }\n}\nclass JSONToken {\n constructor() {\n this.value = null;\n this.type = 0 /* UNKNOWN */;\n this.offset = -1;\n this.len = -1;\n this.line = -1;\n this.char = -1;\n }\n toLocation(filename) {\n return {\n filename: filename,\n line: this.line,\n char: this.char\n };\n }\n}\n/**\n * precondition: the string is known to be valid JSON (https://www.ietf.org/rfc/rfc4627.txt)\n */\nfunction nextJSONToken(_state, _out) {\n _out.value = null;\n _out.type = 0 /* UNKNOWN */;\n _out.offset = -1;\n _out.len = -1;\n _out.line = -1;\n _out.char = -1;\n let source = _state.source;\n let pos = _state.pos;\n let len = _state.len;\n let line = _state.line;\n let char = _state.char;\n //------------------------ skip whitespace\n let chCode;\n do {\n if (pos >= len) {\n return false; /*EOS*/\n }\n chCode = source.charCodeAt(pos);\n if (chCode === 32 /* SPACE */ || chCode === 9 /* HORIZONTAL_TAB */ || chCode === 13 /* CARRIAGE_RETURN */) {\n // regular whitespace\n pos++;\n char++;\n continue;\n }\n if (chCode === 10 /* LINE_FEED */) {\n // newline\n pos++;\n line++;\n char = 0;\n continue;\n }\n // not whitespace\n break;\n } while (true);\n _out.offset = pos;\n _out.line = line;\n _out.char = char;\n if (chCode === 34 /* QUOTATION_MARK */) {\n //------------------------ strings\n _out.type = 1 /* STRING */;\n pos++;\n char++;\n do {\n if (pos >= len) {\n return false; /*EOS*/\n }\n chCode = source.charCodeAt(pos);\n pos++;\n char++;\n if (chCode === 92 /* BACKSLASH */) {\n // skip next char\n pos++;\n char++;\n continue;\n }\n if (chCode === 34 /* QUOTATION_MARK */) {\n // end of the string\n break;\n }\n } while (true);\n _out.value = source.substring(_out.offset + 1, pos - 1).replace(/\\\\u([0-9A-Fa-f]{4})/g, (_, m0) => {\n return String.fromCodePoint(parseInt(m0, 16));\n }).replace(/\\\\(.)/g, (_, m0) => {\n switch (m0) {\n case '\"': return '\"';\n case '\\\\': return '\\\\';\n case '/': return '/';\n case 'b': return '\\b';\n case 'f': return '\\f';\n case 'n': return '\\n';\n case 'r': return '\\r';\n case 't': return '\\t';\n default: doFail(_state, 'invalid escape sequence');\n }\n throw new Error('unreachable');\n });\n }\n else if (chCode === 91 /* LEFT_SQUARE_BRACKET */) {\n _out.type = 2 /* LEFT_SQUARE_BRACKET */;\n pos++;\n char++;\n }\n else if (chCode === 123 /* LEFT_CURLY_BRACKET */) {\n _out.type = 3 /* LEFT_CURLY_BRACKET */;\n pos++;\n char++;\n }\n else if (chCode === 93 /* RIGHT_SQUARE_BRACKET */) {\n _out.type = 4 /* RIGHT_SQUARE_BRACKET */;\n pos++;\n char++;\n }\n else if (chCode === 125 /* RIGHT_CURLY_BRACKET */) {\n _out.type = 5 /* RIGHT_CURLY_BRACKET */;\n pos++;\n char++;\n }\n else if (chCode === 58 /* COLON */) {\n _out.type = 6 /* COLON */;\n pos++;\n char++;\n }\n else if (chCode === 44 /* COMMA */) {\n _out.type = 7 /* COMMA */;\n pos++;\n char++;\n }\n else if (chCode === 110 /* n */) {\n //------------------------ null\n _out.type = 8 /* NULL */;\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 117 /* u */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 108 /* l */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 108 /* l */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n }\n else if (chCode === 116 /* t */) {\n //------------------------ true\n _out.type = 9 /* TRUE */;\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 114 /* r */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 117 /* u */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 101 /* e */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n }\n else if (chCode === 102 /* f */) {\n //------------------------ false\n _out.type = 10 /* FALSE */;\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 97 /* a */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 108 /* l */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 115 /* s */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n chCode = source.charCodeAt(pos);\n if (chCode !== 101 /* e */) {\n return false; /* INVALID */\n }\n pos++;\n char++;\n }\n else {\n //------------------------ numbers\n _out.type = 11 /* NUMBER */;\n do {\n if (pos >= len) {\n return false; /*EOS*/\n }\n chCode = source.charCodeAt(pos);\n if (chCode === 46 /* DOT */\n || (chCode >= 48 /* D0 */ && chCode <= 57 /* D9 */)\n || (chCode === 101 /* e */ || chCode === 69 /* E */)\n || (chCode === 45 /* MINUS */ || chCode === 43 /* PLUS */)) {\n // looks like a piece of a number\n pos++;\n char++;\n continue;\n }\n // pos--; char--;\n break;\n } while (true);\n }\n _out.len = pos - _out.offset;\n if (_out.value === null) {\n _out.value = source.substr(_out.offset, _out.len);\n }\n _state.pos = pos;\n _state.line = line;\n _state.char = char;\n // console.log('PRODUCING TOKEN: ', _out.value, JSONTokenType[_out.type]);\n return true;\n}\n//# sourceMappingURL=json.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseRawGrammar = exports.INITIAL = exports.Registry = void 0;\nconst grammar_1 = require(\"./grammar\");\nconst grammarReader = require(\"./parseRawGrammar\");\nconst registry_1 = require(\"./registry\");\nconst theme_1 = require(\"./theme\");\nconst grammarDependencies_1 = require(\"./grammar/grammarDependencies\");\n__exportStar(require(\"./onigLib\"), exports);\n/**\n * The registry that will hold all grammars.\n */\nclass Registry {\n constructor(options) {\n this._options = options;\n this._syncRegistry = new registry_1.SyncRegistry(theme_1.Theme.createFromRawTheme(options.theme, options.colorMap), options.onigLib);\n this._ensureGrammarCache = new Map();\n }\n dispose() {\n this._syncRegistry.dispose();\n }\n /**\n * Change the theme. Once called, no previous `ruleStack` should be used anymore.\n */\n setTheme(theme, colorMap) {\n this._syncRegistry.setTheme(theme_1.Theme.createFromRawTheme(theme, colorMap));\n }\n /**\n * Returns a lookup array for color ids.\n */\n getColorMap() {\n return this._syncRegistry.getColorMap();\n }\n /**\n * Load the grammar for `scopeName` and all referenced included grammars asynchronously.\n * Please do not use language id 0.\n */\n loadGrammarWithEmbeddedLanguages(initialScopeName, initialLanguage, embeddedLanguages) {\n return this.loadGrammarWithConfiguration(initialScopeName, initialLanguage, { embeddedLanguages });\n }\n /**\n * Load the grammar for `scopeName` and all referenced included grammars asynchronously.\n * Please do not use language id 0.\n */\n loadGrammarWithConfiguration(initialScopeName, initialLanguage, configuration) {\n return this._loadGrammar(initialScopeName, initialLanguage, configuration.embeddedLanguages, configuration.tokenTypes, new grammar_1.BalancedBracketSelectors(configuration.balancedBracketSelectors || [], configuration.unbalancedBracketSelectors || []));\n }\n /**\n * Load the grammar for `scopeName` and all referenced included grammars asynchronously.\n */\n loadGrammar(initialScopeName) {\n return this._loadGrammar(initialScopeName, 0, null, null, null);\n }\n async _loadGrammar(initialScopeName, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors) {\n const dependencyProcessor = new grammarDependencies_1.ScopeDependencyProcessor(this._syncRegistry, initialScopeName);\n while (dependencyProcessor.Q.length > 0) {\n await Promise.all(dependencyProcessor.Q.map((request) => this._loadSingleGrammar(request.scopeName)));\n dependencyProcessor.processQueue();\n }\n return this._grammarForScopeName(initialScopeName, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors);\n }\n async _loadSingleGrammar(scopeName) {\n if (!this._ensureGrammarCache.has(scopeName)) {\n this._ensureGrammarCache.set(scopeName, this._doLoadSingleGrammar(scopeName));\n }\n return this._ensureGrammarCache.get(scopeName);\n }\n async _doLoadSingleGrammar(scopeName) {\n const grammar = await this._options.loadGrammar(scopeName);\n if (grammar) {\n const injections = typeof this._options.getInjections === \"function\" ? this._options.getInjections(scopeName) : undefined;\n this._syncRegistry.addGrammar(grammar, injections);\n }\n }\n /**\n * Adds a rawGrammar.\n */\n async addGrammar(rawGrammar, injections = [], initialLanguage = 0, embeddedLanguages = null) {\n this._syncRegistry.addGrammar(rawGrammar, injections);\n return (await this._grammarForScopeName(rawGrammar.scopeName, initialLanguage, embeddedLanguages));\n }\n /**\n * Get the grammar for `scopeName`. The grammar must first be created via `loadGrammar` or `addGrammar`.\n */\n _grammarForScopeName(scopeName, initialLanguage = 0, embeddedLanguages = null, tokenTypes = null, balancedBracketSelectors = null) {\n return this._syncRegistry.grammarForScopeName(scopeName, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors);\n }\n}\nexports.Registry = Registry;\nexports.INITIAL = grammar_1.StateStack.NULL;\nexports.parseRawGrammar = grammarReader.parseRawGrammar;\n//# sourceMappingURL=main.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMatchers = void 0;\nfunction createMatchers(selector, matchesName) {\n const results = [];\n const tokenizer = newTokenizer(selector);\n let token = tokenizer.next();\n while (token !== null) {\n let priority = 0;\n if (token.length === 2 && token.charAt(1) === ':') {\n switch (token.charAt(0)) {\n case 'R':\n priority = 1;\n break;\n case 'L':\n priority = -1;\n break;\n default:\n console.log(`Unknown priority ${token} in scope selector`);\n }\n token = tokenizer.next();\n }\n let matcher = parseConjunction();\n results.push({ matcher, priority });\n if (token !== ',') {\n break;\n }\n token = tokenizer.next();\n }\n return results;\n function parseOperand() {\n if (token === '-') {\n token = tokenizer.next();\n const expressionToNegate = parseOperand();\n return matcherInput => !!expressionToNegate && !expressionToNegate(matcherInput);\n }\n if (token === '(') {\n token = tokenizer.next();\n const expressionInParents = parseInnerExpression();\n if (token === ')') {\n token = tokenizer.next();\n }\n return expressionInParents;\n }\n if (isIdentifier(token)) {\n const identifiers = [];\n do {\n identifiers.push(token);\n token = tokenizer.next();\n } while (isIdentifier(token));\n return matcherInput => matchesName(identifiers, matcherInput);\n }\n return null;\n }\n function parseConjunction() {\n const matchers = [];\n let matcher = parseOperand();\n while (matcher) {\n matchers.push(matcher);\n matcher = parseOperand();\n }\n return matcherInput => matchers.every(matcher => matcher(matcherInput)); // and\n }\n function parseInnerExpression() {\n const matchers = [];\n let matcher = parseConjunction();\n while (matcher) {\n matchers.push(matcher);\n if (token === '|' || token === ',') {\n do {\n token = tokenizer.next();\n } while (token === '|' || token === ','); // ignore subsequent commas\n }\n else {\n break;\n }\n matcher = parseConjunction();\n }\n return matcherInput => matchers.some(matcher => matcher(matcherInput)); // or\n }\n}\nexports.createMatchers = createMatchers;\nfunction isIdentifier(token) {\n return !!token && !!token.match(/[\\w\\.:]+/);\n}\nfunction newTokenizer(input) {\n let regex = /([LR]:|[\\w\\.:][\\w\\.:\\-]*|[\\,\\|\\-\\(\\)])/g;\n let match = regex.exec(input);\n return {\n next: () => {\n if (!match) {\n return null;\n }\n const res = match[0];\n match = regex.exec(input);\n return res;\n }\n };\n}\n//# sourceMappingURL=matcher.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.disposeOnigString = void 0;\nfunction disposeOnigString(str) {\n if (typeof str.dispose === 'function') {\n str.dispose();\n }\n}\nexports.disposeOnigString = disposeOnigString;\n//# sourceMappingURL=onigLib.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseRawGrammar = void 0;\nconst plist = require(\"./plist\");\nconst debug_1 = require(\"./debug\");\nconst json_1 = require(\"./json\");\nfunction parseRawGrammar(content, filePath = null) {\n if (filePath !== null && /\\.json$/.test(filePath)) {\n return parseJSONGrammar(content, filePath);\n }\n return parsePLISTGrammar(content, filePath);\n}\nexports.parseRawGrammar = parseRawGrammar;\nfunction parseJSONGrammar(contents, filename) {\n if (debug_1.DebugFlags.InDebugMode) {\n return json_1.parseJSON(contents, filename, true);\n }\n return JSON.parse(contents);\n}\nfunction parsePLISTGrammar(contents, filename) {\n if (debug_1.DebugFlags.InDebugMode) {\n return plist.parseWithLocation(contents, filename, '$vscodeTextmateLocation');\n }\n return plist.parsePLIST(contents);\n}\n//# sourceMappingURL=parseRawGrammar.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parsePLIST = exports.parseWithLocation = void 0;\nfunction parseWithLocation(content, filename, locationKeyName) {\n return _parse(content, filename, locationKeyName);\n}\nexports.parseWithLocation = parseWithLocation;\n/**\n * A very fast plist parser\n */\nfunction parsePLIST(content) {\n return _parse(content, null, null);\n}\nexports.parsePLIST = parsePLIST;\nfunction _parse(content, filename, locationKeyName) {\n const len = content.length;\n let pos = 0;\n let line = 1;\n let char = 0;\n // Skip UTF8 BOM\n if (len > 0 && content.charCodeAt(0) === 65279 /* BOM */) {\n pos = 1;\n }\n function advancePosBy(by) {\n if (locationKeyName === null) {\n pos = pos + by;\n }\n else {\n while (by > 0) {\n let chCode = content.charCodeAt(pos);\n if (chCode === 10 /* LINE_FEED */) {\n pos++;\n line++;\n char = 0;\n }\n else {\n pos++;\n char++;\n }\n by--;\n }\n }\n }\n function advancePosTo(to) {\n if (locationKeyName === null) {\n pos = to;\n }\n else {\n advancePosBy(to - pos);\n }\n }\n function skipWhitespace() {\n while (pos < len) {\n let chCode = content.charCodeAt(pos);\n if (chCode !== 32 /* SPACE */ && chCode !== 9 /* TAB */ && chCode !== 13 /* CARRIAGE_RETURN */ && chCode !== 10 /* LINE_FEED */) {\n break;\n }\n advancePosBy(1);\n }\n }\n function advanceIfStartsWith(str) {\n if (content.substr(pos, str.length) === str) {\n advancePosBy(str.length);\n return true;\n }\n return false;\n }\n function advanceUntil(str) {\n let nextOccurence = content.indexOf(str, pos);\n if (nextOccurence !== -1) {\n advancePosTo(nextOccurence + str.length);\n }\n else {\n // EOF\n advancePosTo(len);\n }\n }\n function captureUntil(str) {\n let nextOccurence = content.indexOf(str, pos);\n if (nextOccurence !== -1) {\n let r = content.substring(pos, nextOccurence);\n advancePosTo(nextOccurence + str.length);\n return r;\n }\n else {\n // EOF\n let r = content.substr(pos);\n advancePosTo(len);\n return r;\n }\n }\n let state = 0 /* ROOT_STATE */;\n let cur = null;\n let stateStack = [];\n let objStack = [];\n let curKey = null;\n function pushState(newState, newCur) {\n stateStack.push(state);\n objStack.push(cur);\n state = newState;\n cur = newCur;\n }\n function popState() {\n if (stateStack.length === 0) {\n return fail('illegal state stack');\n }\n state = stateStack.pop();\n cur = objStack.pop();\n }\n function fail(msg) {\n throw new Error('Near offset ' + pos + ': ' + msg + ' ~~~' + content.substr(pos, 50) + '~~~');\n }\n const dictState = {\n enterDict: function () {\n if (curKey === null) {\n return fail('missing ');\n }\n let newDict = {};\n if (locationKeyName !== null) {\n newDict[locationKeyName] = {\n filename: filename,\n line: line,\n char: char\n };\n }\n cur[curKey] = newDict;\n curKey = null;\n pushState(1 /* DICT_STATE */, newDict);\n },\n enterArray: function () {\n if (curKey === null) {\n return fail('missing ');\n }\n let newArr = [];\n cur[curKey] = newArr;\n curKey = null;\n pushState(2 /* ARR_STATE */, newArr);\n }\n };\n const arrState = {\n enterDict: function () {\n let newDict = {};\n if (locationKeyName !== null) {\n newDict[locationKeyName] = {\n filename: filename,\n line: line,\n char: char\n };\n }\n cur.push(newDict);\n pushState(1 /* DICT_STATE */, newDict);\n },\n enterArray: function () {\n let newArr = [];\n cur.push(newArr);\n pushState(2 /* ARR_STATE */, newArr);\n }\n };\n function enterDict() {\n if (state === 1 /* DICT_STATE */) {\n dictState.enterDict();\n }\n else if (state === 2 /* ARR_STATE */) {\n arrState.enterDict();\n }\n else { // ROOT_STATE\n cur = {};\n if (locationKeyName !== null) {\n cur[locationKeyName] = {\n filename: filename,\n line: line,\n char: char\n };\n }\n pushState(1 /* DICT_STATE */, cur);\n }\n }\n function leaveDict() {\n if (state === 1 /* DICT_STATE */) {\n popState();\n }\n else if (state === 2 /* ARR_STATE */) {\n return fail('unexpected ');\n }\n else { // ROOT_STATE\n return fail('unexpected ');\n }\n }\n function enterArray() {\n if (state === 1 /* DICT_STATE */) {\n dictState.enterArray();\n }\n else if (state === 2 /* ARR_STATE */) {\n arrState.enterArray();\n }\n else { // ROOT_STATE\n cur = [];\n pushState(2 /* ARR_STATE */, cur);\n }\n }\n function leaveArray() {\n if (state === 1 /* DICT_STATE */) {\n return fail('unexpected ');\n }\n else if (state === 2 /* ARR_STATE */) {\n popState();\n }\n else { // ROOT_STATE\n return fail('unexpected ');\n }\n }\n function acceptKey(val) {\n if (state === 1 /* DICT_STATE */) {\n if (curKey !== null) {\n return fail('too many ');\n }\n curKey = val;\n }\n else if (state === 2 /* ARR_STATE */) {\n return fail('unexpected ');\n }\n else { // ROOT_STATE\n return fail('unexpected ');\n }\n }\n function acceptString(val) {\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function acceptReal(val) {\n if (isNaN(val)) {\n return fail('cannot parse float');\n }\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function acceptInteger(val) {\n if (isNaN(val)) {\n return fail('cannot parse integer');\n }\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function acceptDate(val) {\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function acceptData(val) {\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function acceptBool(val) {\n if (state === 1 /* DICT_STATE */) {\n if (curKey === null) {\n return fail('missing ');\n }\n cur[curKey] = val;\n curKey = null;\n }\n else if (state === 2 /* ARR_STATE */) {\n cur.push(val);\n }\n else { // ROOT_STATE\n cur = val;\n }\n }\n function escapeVal(str) {\n return str.replace(/&#([0-9]+);/g, function (_, m0) {\n return String.fromCodePoint(parseInt(m0, 10));\n }).replace(/&#x([0-9a-f]+);/g, function (_, m0) {\n return String.fromCodePoint(parseInt(m0, 16));\n }).replace(/&|<|>|"|'/g, function (_) {\n switch (_) {\n case '&': return '&';\n case '<': return '<';\n case '>': return '>';\n case '"': return '\"';\n case ''': return '\\'';\n }\n return _;\n });\n }\n function parseOpenTag() {\n let r = captureUntil('>');\n let isClosed = false;\n if (r.charCodeAt(r.length - 1) === 47 /* SLASH */) {\n isClosed = true;\n r = r.substring(0, r.length - 1);\n }\n return {\n name: r.trim(),\n isClosed: isClosed\n };\n }\n function parseTagValue(tag) {\n if (tag.isClosed) {\n return '';\n }\n let val = captureUntil('');\n return escapeVal(val);\n }\n while (pos < len) {\n skipWhitespace();\n if (pos >= len) {\n break;\n }\n const chCode = content.charCodeAt(pos);\n advancePosBy(1);\n if (chCode !== 60 /* LESS_THAN */) {\n return fail('expected <');\n }\n if (pos >= len) {\n return fail('unexpected end of input');\n }\n const peekChCode = content.charCodeAt(pos);\n if (peekChCode === 63 /* QUESTION_MARK */) {\n advancePosBy(1);\n advanceUntil('?>');\n continue;\n }\n if (peekChCode === 33 /* EXCLAMATION_MARK */) {\n advancePosBy(1);\n if (advanceIfStartsWith('--')) {\n advanceUntil('-->');\n continue;\n }\n advanceUntil('>');\n continue;\n }\n if (peekChCode === 47 /* SLASH */) {\n advancePosBy(1);\n skipWhitespace();\n if (advanceIfStartsWith('plist')) {\n advanceUntil('>');\n continue;\n }\n if (advanceIfStartsWith('dict')) {\n advanceUntil('>');\n leaveDict();\n continue;\n }\n if (advanceIfStartsWith('array')) {\n advanceUntil('>');\n leaveArray();\n continue;\n }\n return fail('unexpected closed tag');\n }\n let tag = parseOpenTag();\n switch (tag.name) {\n case 'dict':\n enterDict();\n if (tag.isClosed) {\n leaveDict();\n }\n continue;\n case 'array':\n enterArray();\n if (tag.isClosed) {\n leaveArray();\n }\n continue;\n case 'key':\n acceptKey(parseTagValue(tag));\n continue;\n case 'string':\n acceptString(parseTagValue(tag));\n continue;\n case 'real':\n acceptReal(parseFloat(parseTagValue(tag)));\n continue;\n case 'integer':\n acceptInteger(parseInt(parseTagValue(tag), 10));\n continue;\n case 'date':\n acceptDate(new Date(parseTagValue(tag)));\n continue;\n case 'data':\n acceptData(parseTagValue(tag));\n continue;\n case 'true':\n parseTagValue(tag);\n acceptBool(true);\n continue;\n case 'false':\n parseTagValue(tag);\n acceptBool(false);\n continue;\n }\n if (/^plist/.test(tag.name)) {\n continue;\n }\n return fail('unexpected opened tag ' + tag.name);\n }\n return cur;\n}\n//# sourceMappingURL=plist.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncRegistry = void 0;\nconst grammar_1 = require(\"./grammar\");\nclass SyncRegistry {\n constructor(theme, _onigLibPromise) {\n this._onigLibPromise = _onigLibPromise;\n this._grammars = new Map();\n this._rawGrammars = new Map();\n this._injectionGrammars = new Map();\n this._theme = theme;\n }\n dispose() {\n for (const grammar of this._grammars.values()) {\n grammar.dispose();\n }\n }\n setTheme(theme) {\n this._theme = theme;\n }\n getColorMap() {\n return this._theme.getColorMap();\n }\n /**\n * Add `grammar` to registry and return a list of referenced scope names\n */\n addGrammar(grammar, injectionScopeNames) {\n this._rawGrammars.set(grammar.scopeName, grammar);\n if (injectionScopeNames) {\n this._injectionGrammars.set(grammar.scopeName, injectionScopeNames);\n }\n }\n /**\n * Lookup a raw grammar.\n */\n lookup(scopeName) {\n return this._rawGrammars.get(scopeName);\n }\n /**\n * Returns the injections for the given grammar\n */\n injections(targetScope) {\n return this._injectionGrammars.get(targetScope);\n }\n /**\n * Get the default theme settings\n */\n getDefaults() {\n return this._theme.getDefaults();\n }\n /**\n * Match a scope in the theme.\n */\n themeMatch(scopePath) {\n return this._theme.match(scopePath);\n }\n /**\n * Lookup a grammar.\n */\n async grammarForScopeName(scopeName, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors) {\n if (!this._grammars.has(scopeName)) {\n let rawGrammar = this._rawGrammars.get(scopeName);\n if (!rawGrammar) {\n return null;\n }\n this._grammars.set(scopeName, grammar_1.createGrammar(scopeName, rawGrammar, initialLanguage, embeddedLanguages, tokenTypes, balancedBracketSelectors, this, await this._onigLibPromise));\n }\n return this._grammars.get(scopeName);\n }\n}\nexports.SyncRegistry = SyncRegistry;\n//# sourceMappingURL=registry.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompiledRule = exports.RegExpSourceList = exports.RegExpSource = exports.RuleFactory = exports.BeginWhileRule = exports.BeginEndRule = exports.IncludeOnlyRule = exports.MatchRule = exports.CaptureRule = exports.Rule = exports.ruleIdToNumber = exports.ruleIdFromNumber = exports.whileRuleId = exports.endRuleId = void 0;\nconst utils_1 = require(\"./utils\");\nconst grammarDependencies_1 = require(\"./grammar/grammarDependencies\");\nconst HAS_BACK_REFERENCES = /\\\\(\\d+)/;\nconst BACK_REFERENCING_END = /\\\\(\\d+)/g;\nconst ruleIdSymbol = Symbol('RuleId');\n// This is a special constant to indicate that the end regexp matched.\nexports.endRuleId = -1;\n// This is a special constant to indicate that the while regexp matched.\nexports.whileRuleId = -2;\nfunction ruleIdFromNumber(id) {\n return id;\n}\nexports.ruleIdFromNumber = ruleIdFromNumber;\nfunction ruleIdToNumber(id) {\n return id;\n}\nexports.ruleIdToNumber = ruleIdToNumber;\nclass Rule {\n constructor($location, id, name, contentName) {\n this.$location = $location;\n this.id = id;\n this._name = name || null;\n this._nameIsCapturing = utils_1.RegexSource.hasCaptures(this._name);\n this._contentName = contentName || null;\n this._contentNameIsCapturing = utils_1.RegexSource.hasCaptures(this._contentName);\n }\n get debugName() {\n const location = this.$location ? `${utils_1.basename(this.$location.filename)}:${this.$location.line}` : 'unknown';\n return `${this.constructor.name}#${this.id} @ ${location}`;\n }\n getName(lineText, captureIndices) {\n if (!this._nameIsCapturing || this._name === null || lineText === null || captureIndices === null) {\n return this._name;\n }\n return utils_1.RegexSource.replaceCaptures(this._name, lineText, captureIndices);\n }\n getContentName(lineText, captureIndices) {\n if (!this._contentNameIsCapturing || this._contentName === null) {\n return this._contentName;\n }\n return utils_1.RegexSource.replaceCaptures(this._contentName, lineText, captureIndices);\n }\n}\nexports.Rule = Rule;\nclass CaptureRule extends Rule {\n constructor($location, id, name, contentName, retokenizeCapturedWithRuleId) {\n super($location, id, name, contentName);\n this.retokenizeCapturedWithRuleId = retokenizeCapturedWithRuleId;\n }\n dispose() {\n // nothing to dispose\n }\n collectPatterns(grammar, out) {\n throw new Error('Not supported!');\n }\n compile(grammar, endRegexSource) {\n throw new Error('Not supported!');\n }\n compileAG(grammar, endRegexSource, allowA, allowG) {\n throw new Error('Not supported!');\n }\n}\nexports.CaptureRule = CaptureRule;\nclass MatchRule extends Rule {\n constructor($location, id, name, match, captures) {\n super($location, id, name, null);\n this._match = new RegExpSource(match, this.id);\n this.captures = captures;\n this._cachedCompiledPatterns = null;\n }\n dispose() {\n if (this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns.dispose();\n this._cachedCompiledPatterns = null;\n }\n }\n get debugMatchRegExp() {\n return `${this._match.source}`;\n }\n collectPatterns(grammar, out) {\n out.push(this._match);\n }\n compile(grammar, endRegexSource) {\n return this._getCachedCompiledPatterns(grammar).compile(grammar);\n }\n compileAG(grammar, endRegexSource, allowA, allowG) {\n return this._getCachedCompiledPatterns(grammar).compileAG(grammar, allowA, allowG);\n }\n _getCachedCompiledPatterns(grammar) {\n if (!this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns = new RegExpSourceList();\n this.collectPatterns(grammar, this._cachedCompiledPatterns);\n }\n return this._cachedCompiledPatterns;\n }\n}\nexports.MatchRule = MatchRule;\nclass IncludeOnlyRule extends Rule {\n constructor($location, id, name, contentName, patterns) {\n super($location, id, name, contentName);\n this.patterns = patterns.patterns;\n this.hasMissingPatterns = patterns.hasMissingPatterns;\n this._cachedCompiledPatterns = null;\n }\n dispose() {\n if (this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns.dispose();\n this._cachedCompiledPatterns = null;\n }\n }\n collectPatterns(grammar, out) {\n for (const pattern of this.patterns) {\n const rule = grammar.getRule(pattern);\n rule.collectPatterns(grammar, out);\n }\n }\n compile(grammar, endRegexSource) {\n return this._getCachedCompiledPatterns(grammar).compile(grammar);\n }\n compileAG(grammar, endRegexSource, allowA, allowG) {\n return this._getCachedCompiledPatterns(grammar).compileAG(grammar, allowA, allowG);\n }\n _getCachedCompiledPatterns(grammar) {\n if (!this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns = new RegExpSourceList();\n this.collectPatterns(grammar, this._cachedCompiledPatterns);\n }\n return this._cachedCompiledPatterns;\n }\n}\nexports.IncludeOnlyRule = IncludeOnlyRule;\nclass BeginEndRule extends Rule {\n constructor($location, id, name, contentName, begin, beginCaptures, end, endCaptures, applyEndPatternLast, patterns) {\n super($location, id, name, contentName);\n this._begin = new RegExpSource(begin, this.id);\n this.beginCaptures = beginCaptures;\n this._end = new RegExpSource(end ? end : '\\uFFFF', -1);\n this.endHasBackReferences = this._end.hasBackReferences;\n this.endCaptures = endCaptures;\n this.applyEndPatternLast = applyEndPatternLast || false;\n this.patterns = patterns.patterns;\n this.hasMissingPatterns = patterns.hasMissingPatterns;\n this._cachedCompiledPatterns = null;\n }\n dispose() {\n if (this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns.dispose();\n this._cachedCompiledPatterns = null;\n }\n }\n get debugBeginRegExp() {\n return `${this._begin.source}`;\n }\n get debugEndRegExp() {\n return `${this._end.source}`;\n }\n getEndWithResolvedBackReferences(lineText, captureIndices) {\n return this._end.resolveBackReferences(lineText, captureIndices);\n }\n collectPatterns(grammar, out) {\n out.push(this._begin);\n }\n compile(grammar, endRegexSource) {\n return this._getCachedCompiledPatterns(grammar, endRegexSource).compile(grammar);\n }\n compileAG(grammar, endRegexSource, allowA, allowG) {\n return this._getCachedCompiledPatterns(grammar, endRegexSource).compileAG(grammar, allowA, allowG);\n }\n _getCachedCompiledPatterns(grammar, endRegexSource) {\n if (!this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns = new RegExpSourceList();\n for (const pattern of this.patterns) {\n const rule = grammar.getRule(pattern);\n rule.collectPatterns(grammar, this._cachedCompiledPatterns);\n }\n if (this.applyEndPatternLast) {\n this._cachedCompiledPatterns.push(this._end.hasBackReferences ? this._end.clone() : this._end);\n }\n else {\n this._cachedCompiledPatterns.unshift(this._end.hasBackReferences ? this._end.clone() : this._end);\n }\n }\n if (this._end.hasBackReferences) {\n if (this.applyEndPatternLast) {\n this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, endRegexSource);\n }\n else {\n this._cachedCompiledPatterns.setSource(0, endRegexSource);\n }\n }\n return this._cachedCompiledPatterns;\n }\n}\nexports.BeginEndRule = BeginEndRule;\nclass BeginWhileRule extends Rule {\n constructor($location, id, name, contentName, begin, beginCaptures, _while, whileCaptures, patterns) {\n super($location, id, name, contentName);\n this._begin = new RegExpSource(begin, this.id);\n this.beginCaptures = beginCaptures;\n this.whileCaptures = whileCaptures;\n this._while = new RegExpSource(_while, exports.whileRuleId);\n this.whileHasBackReferences = this._while.hasBackReferences;\n this.patterns = patterns.patterns;\n this.hasMissingPatterns = patterns.hasMissingPatterns;\n this._cachedCompiledPatterns = null;\n this._cachedCompiledWhilePatterns = null;\n }\n dispose() {\n if (this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns.dispose();\n this._cachedCompiledPatterns = null;\n }\n if (this._cachedCompiledWhilePatterns) {\n this._cachedCompiledWhilePatterns.dispose();\n this._cachedCompiledWhilePatterns = null;\n }\n }\n get debugBeginRegExp() {\n return `${this._begin.source}`;\n }\n get debugWhileRegExp() {\n return `${this._while.source}`;\n }\n getWhileWithResolvedBackReferences(lineText, captureIndices) {\n return this._while.resolveBackReferences(lineText, captureIndices);\n }\n collectPatterns(grammar, out) {\n out.push(this._begin);\n }\n compile(grammar, endRegexSource) {\n return this._getCachedCompiledPatterns(grammar).compile(grammar);\n }\n compileAG(grammar, endRegexSource, allowA, allowG) {\n return this._getCachedCompiledPatterns(grammar).compileAG(grammar, allowA, allowG);\n }\n _getCachedCompiledPatterns(grammar) {\n if (!this._cachedCompiledPatterns) {\n this._cachedCompiledPatterns = new RegExpSourceList();\n for (const pattern of this.patterns) {\n const rule = grammar.getRule(pattern);\n rule.collectPatterns(grammar, this._cachedCompiledPatterns);\n }\n }\n return this._cachedCompiledPatterns;\n }\n compileWhile(grammar, endRegexSource) {\n return this._getCachedCompiledWhilePatterns(grammar, endRegexSource).compile(grammar);\n }\n compileWhileAG(grammar, endRegexSource, allowA, allowG) {\n return this._getCachedCompiledWhilePatterns(grammar, endRegexSource).compileAG(grammar, allowA, allowG);\n }\n _getCachedCompiledWhilePatterns(grammar, endRegexSource) {\n if (!this._cachedCompiledWhilePatterns) {\n this._cachedCompiledWhilePatterns = new RegExpSourceList();\n this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences ? this._while.clone() : this._while);\n }\n if (this._while.hasBackReferences) {\n this._cachedCompiledWhilePatterns.setSource(0, endRegexSource ? endRegexSource : '\\uFFFF');\n }\n return this._cachedCompiledWhilePatterns;\n }\n}\nexports.BeginWhileRule = BeginWhileRule;\nclass RuleFactory {\n static createCaptureRule(helper, $location, name, contentName, retokenizeCapturedWithRuleId) {\n return helper.registerRule((id) => {\n return new CaptureRule($location, id, name, contentName, retokenizeCapturedWithRuleId);\n });\n }\n static getCompiledRuleId(desc, helper, repository) {\n if (!desc.id) {\n helper.registerRule((id) => {\n desc.id = id;\n if (desc.match) {\n return new MatchRule(desc.$vscodeTextmateLocation, desc.id, desc.name, desc.match, RuleFactory._compileCaptures(desc.captures, helper, repository));\n }\n if (typeof desc.begin === 'undefined') {\n if (desc.repository) {\n repository = utils_1.mergeObjects({}, repository, desc.repository);\n }\n let patterns = desc.patterns;\n if (typeof patterns === 'undefined' && desc.include) {\n patterns = [{ include: desc.include }];\n }\n return new IncludeOnlyRule(desc.$vscodeTextmateLocation, desc.id, desc.name, desc.contentName, RuleFactory._compilePatterns(patterns, helper, repository));\n }\n if (desc.while) {\n return new BeginWhileRule(desc.$vscodeTextmateLocation, desc.id, desc.name, desc.contentName, desc.begin, RuleFactory._compileCaptures(desc.beginCaptures || desc.captures, helper, repository), desc.while, RuleFactory._compileCaptures(desc.whileCaptures || desc.captures, helper, repository), RuleFactory._compilePatterns(desc.patterns, helper, repository));\n }\n return new BeginEndRule(desc.$vscodeTextmateLocation, desc.id, desc.name, desc.contentName, desc.begin, RuleFactory._compileCaptures(desc.beginCaptures || desc.captures, helper, repository), desc.end, RuleFactory._compileCaptures(desc.endCaptures || desc.captures, helper, repository), desc.applyEndPatternLast, RuleFactory._compilePatterns(desc.patterns, helper, repository));\n });\n }\n return desc.id;\n }\n static _compileCaptures(captures, helper, repository) {\n let r = [];\n if (captures) {\n // Find the maximum capture id\n let maximumCaptureId = 0;\n for (const captureId in captures) {\n if (captureId === '$vscodeTextmateLocation') {\n continue;\n }\n const numericCaptureId = parseInt(captureId, 10);\n if (numericCaptureId > maximumCaptureId) {\n maximumCaptureId = numericCaptureId;\n }\n }\n // Initialize result\n for (let i = 0; i <= maximumCaptureId; i++) {\n r[i] = null;\n }\n // Fill out result\n for (const captureId in captures) {\n if (captureId === '$vscodeTextmateLocation') {\n continue;\n }\n const numericCaptureId = parseInt(captureId, 10);\n let retokenizeCapturedWithRuleId = 0;\n if (captures[captureId].patterns) {\n retokenizeCapturedWithRuleId = RuleFactory.getCompiledRuleId(captures[captureId], helper, repository);\n }\n r[numericCaptureId] = RuleFactory.createCaptureRule(helper, captures[captureId].$vscodeTextmateLocation, captures[captureId].name, captures[captureId].contentName, retokenizeCapturedWithRuleId);\n }\n }\n return r;\n }\n static _compilePatterns(patterns, helper, repository) {\n let r = [];\n if (patterns) {\n for (let i = 0, len = patterns.length; i < len; i++) {\n const pattern = patterns[i];\n let ruleId = -1;\n if (pattern.include) {\n const reference = grammarDependencies_1.parseInclude(pattern.include);\n switch (reference.kind) {\n case 0 /* Base */:\n case 1 /* Self */:\n ruleId = RuleFactory.getCompiledRuleId(repository[pattern.include], helper, repository);\n break;\n case 2 /* RelativeReference */:\n // Local include found in `repository`\n let localIncludedRule = repository[reference.ruleName];\n if (localIncludedRule) {\n ruleId = RuleFactory.getCompiledRuleId(localIncludedRule, helper, repository);\n }\n else {\n // console.warn('CANNOT find rule for scopeName: ' + pattern.include + ', I am: ', repository['$base'].name);\n }\n break;\n case 3 /* TopLevelReference */:\n case 4 /* TopLevelRepositoryReference */:\n const externalGrammarName = reference.scopeName;\n const externalGrammarInclude = reference.kind === 4 /* TopLevelRepositoryReference */\n ? reference.ruleName\n : null;\n // External include\n const externalGrammar = helper.getExternalGrammar(externalGrammarName, repository);\n if (externalGrammar) {\n if (externalGrammarInclude) {\n let externalIncludedRule = externalGrammar.repository[externalGrammarInclude];\n if (externalIncludedRule) {\n ruleId = RuleFactory.getCompiledRuleId(externalIncludedRule, helper, externalGrammar.repository);\n }\n else {\n // console.warn('CANNOT find rule for scopeName: ' + pattern.include + ', I am: ', repository['$base'].name);\n }\n }\n else {\n ruleId = RuleFactory.getCompiledRuleId(externalGrammar.repository.$self, helper, externalGrammar.repository);\n }\n }\n else {\n // console.warn('CANNOT find grammar for scopeName: ' + pattern.include + ', I am: ', repository['$base'].name);\n }\n break;\n }\n }\n else {\n ruleId = RuleFactory.getCompiledRuleId(pattern, helper, repository);\n }\n if (ruleId !== -1) {\n const rule = helper.getRule(ruleId);\n let skipRule = false;\n if (rule instanceof IncludeOnlyRule || rule instanceof BeginEndRule || rule instanceof BeginWhileRule) {\n if (rule.hasMissingPatterns && rule.patterns.length === 0) {\n skipRule = true;\n }\n }\n if (skipRule) {\n // console.log('REMOVING RULE ENTIRELY DUE TO EMPTY PATTERNS THAT ARE MISSING');\n continue;\n }\n r.push(ruleId);\n }\n }\n }\n return {\n patterns: r,\n hasMissingPatterns: ((patterns ? patterns.length : 0) !== r.length)\n };\n }\n}\nexports.RuleFactory = RuleFactory;\nclass RegExpSource {\n constructor(regExpSource, ruleId) {\n if (regExpSource) {\n const len = regExpSource.length;\n let lastPushedPos = 0;\n let output = [];\n let hasAnchor = false;\n for (let pos = 0; pos < len; pos++) {\n const ch = regExpSource.charAt(pos);\n if (ch === '\\\\') {\n if (pos + 1 < len) {\n const nextCh = regExpSource.charAt(pos + 1);\n if (nextCh === 'z') {\n output.push(regExpSource.substring(lastPushedPos, pos));\n output.push('$(?!\\\\n)(? ' + this.source + ', ' + this.hasAnchor);\n }\n clone() {\n return new RegExpSource(this.source, this.ruleId);\n }\n setSource(newSource) {\n if (this.source === newSource) {\n return;\n }\n this.source = newSource;\n if (this.hasAnchor) {\n this._anchorCache = this._buildAnchorCache();\n }\n }\n resolveBackReferences(lineText, captureIndices) {\n let capturedValues = captureIndices.map((capture) => {\n return lineText.substring(capture.start, capture.end);\n });\n BACK_REFERENCING_END.lastIndex = 0;\n return this.source.replace(BACK_REFERENCING_END, (match, g1) => {\n return utils_1.escapeRegExpCharacters(capturedValues[parseInt(g1, 10)] || '');\n });\n }\n _buildAnchorCache() {\n let A0_G0_result = [];\n let A0_G1_result = [];\n let A1_G0_result = [];\n let A1_G1_result = [];\n let pos, len, ch, nextCh;\n for (pos = 0, len = this.source.length; pos < len; pos++) {\n ch = this.source.charAt(pos);\n A0_G0_result[pos] = ch;\n A0_G1_result[pos] = ch;\n A1_G0_result[pos] = ch;\n A1_G1_result[pos] = ch;\n if (ch === '\\\\') {\n if (pos + 1 < len) {\n nextCh = this.source.charAt(pos + 1);\n if (nextCh === 'A') {\n A0_G0_result[pos + 1] = '\\uFFFF';\n A0_G1_result[pos + 1] = '\\uFFFF';\n A1_G0_result[pos + 1] = 'A';\n A1_G1_result[pos + 1] = 'A';\n }\n else if (nextCh === 'G') {\n A0_G0_result[pos + 1] = '\\uFFFF';\n A0_G1_result[pos + 1] = 'G';\n A1_G0_result[pos + 1] = '\\uFFFF';\n A1_G1_result[pos + 1] = 'G';\n }\n else {\n A0_G0_result[pos + 1] = nextCh;\n A0_G1_result[pos + 1] = nextCh;\n A1_G0_result[pos + 1] = nextCh;\n A1_G1_result[pos + 1] = nextCh;\n }\n pos++;\n }\n }\n }\n return {\n A0_G0: A0_G0_result.join(''),\n A0_G1: A0_G1_result.join(''),\n A1_G0: A1_G0_result.join(''),\n A1_G1: A1_G1_result.join('')\n };\n }\n resolveAnchors(allowA, allowG) {\n if (!this.hasAnchor || !this._anchorCache) {\n return this.source;\n }\n if (allowA) {\n if (allowG) {\n return this._anchorCache.A1_G1;\n }\n else {\n return this._anchorCache.A1_G0;\n }\n }\n else {\n if (allowG) {\n return this._anchorCache.A0_G1;\n }\n else {\n return this._anchorCache.A0_G0;\n }\n }\n }\n}\nexports.RegExpSource = RegExpSource;\nclass RegExpSourceList {\n constructor() {\n this._items = [];\n this._hasAnchors = false;\n this._cached = null;\n this._anchorCache = {\n A0_G0: null,\n A0_G1: null,\n A1_G0: null,\n A1_G1: null\n };\n }\n dispose() {\n this._disposeCaches();\n }\n _disposeCaches() {\n if (this._cached) {\n this._cached.dispose();\n this._cached = null;\n }\n if (this._anchorCache.A0_G0) {\n this._anchorCache.A0_G0.dispose();\n this._anchorCache.A0_G0 = null;\n }\n if (this._anchorCache.A0_G1) {\n this._anchorCache.A0_G1.dispose();\n this._anchorCache.A0_G1 = null;\n }\n if (this._anchorCache.A1_G0) {\n this._anchorCache.A1_G0.dispose();\n this._anchorCache.A1_G0 = null;\n }\n if (this._anchorCache.A1_G1) {\n this._anchorCache.A1_G1.dispose();\n this._anchorCache.A1_G1 = null;\n }\n }\n push(item) {\n this._items.push(item);\n this._hasAnchors = this._hasAnchors || item.hasAnchor;\n }\n unshift(item) {\n this._items.unshift(item);\n this._hasAnchors = this._hasAnchors || item.hasAnchor;\n }\n length() {\n return this._items.length;\n }\n setSource(index, newSource) {\n if (this._items[index].source !== newSource) {\n // bust the cache\n this._disposeCaches();\n this._items[index].setSource(newSource);\n }\n }\n compile(onigLib) {\n if (!this._cached) {\n let regExps = this._items.map(e => e.source);\n this._cached = new CompiledRule(onigLib, regExps, this._items.map(e => e.ruleId));\n }\n return this._cached;\n }\n compileAG(onigLib, allowA, allowG) {\n if (!this._hasAnchors) {\n return this.compile(onigLib);\n }\n else {\n if (allowA) {\n if (allowG) {\n if (!this._anchorCache.A1_G1) {\n this._anchorCache.A1_G1 = this._resolveAnchors(onigLib, allowA, allowG);\n }\n return this._anchorCache.A1_G1;\n }\n else {\n if (!this._anchorCache.A1_G0) {\n this._anchorCache.A1_G0 = this._resolveAnchors(onigLib, allowA, allowG);\n }\n return this._anchorCache.A1_G0;\n }\n }\n else {\n if (allowG) {\n if (!this._anchorCache.A0_G1) {\n this._anchorCache.A0_G1 = this._resolveAnchors(onigLib, allowA, allowG);\n }\n return this._anchorCache.A0_G1;\n }\n else {\n if (!this._anchorCache.A0_G0) {\n this._anchorCache.A0_G0 = this._resolveAnchors(onigLib, allowA, allowG);\n }\n return this._anchorCache.A0_G0;\n }\n }\n }\n }\n _resolveAnchors(onigLib, allowA, allowG) {\n let regExps = this._items.map(e => e.resolveAnchors(allowA, allowG));\n return new CompiledRule(onigLib, regExps, this._items.map(e => e.ruleId));\n }\n}\nexports.RegExpSourceList = RegExpSourceList;\nclass CompiledRule {\n constructor(onigLib, regExps, rules) {\n this.regExps = regExps;\n this.rules = rules;\n this.scanner = onigLib.createOnigScanner(regExps);\n }\n dispose() {\n if (typeof this.scanner.dispose === \"function\") {\n this.scanner.dispose();\n }\n }\n toString() {\n const r = [];\n for (let i = 0, len = this.rules.length; i < len; i++) {\n r.push(\" - \" + this.rules[i] + \": \" + this.regExps[i]);\n }\n return r.join(\"\\n\");\n }\n findNextMatchSync(string, startPosition, options) {\n const result = this.scanner.findNextMatchSync(string, startPosition, options);\n if (!result) {\n return null;\n }\n return {\n ruleId: this.rules[result.index],\n captureIndices: result.captureIndices,\n };\n }\n}\nexports.CompiledRule = CompiledRule;\n//# sourceMappingURL=rule.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThemeTrieElement = exports.ThemeTrieElementRule = exports.ColorMap = exports.fontStyleToString = exports.ParsedThemeRule = exports.parseTheme = exports.StyleAttributes = exports.ScopeStack = exports.Theme = void 0;\nconst utils_1 = require(\"./utils\");\nclass Theme {\n constructor(_colorMap, _defaults, _root) {\n this._colorMap = _colorMap;\n this._defaults = _defaults;\n this._root = _root;\n this._cachedMatchRoot = new utils_1.CachedFn((scopeName) => this._root.match(scopeName));\n }\n static createFromRawTheme(source, colorMap) {\n return this.createFromParsedTheme(parseTheme(source), colorMap);\n }\n static createFromParsedTheme(source, colorMap) {\n return resolveParsedThemeRules(source, colorMap);\n }\n getColorMap() {\n return this._colorMap.getColorMap();\n }\n getDefaults() {\n return this._defaults;\n }\n match(scopePath) {\n if (scopePath === null) {\n return this._defaults;\n }\n const scopeName = scopePath.scopeName;\n const matchingTrieElements = this._cachedMatchRoot.get(scopeName);\n const effectiveRule = matchingTrieElements.find((v) => _scopePathMatchesParentScopes(scopePath.parent, v.parentScopes));\n if (!effectiveRule) {\n return null;\n }\n return new StyleAttributes(effectiveRule.fontStyle, effectiveRule.foreground, effectiveRule.background);\n }\n}\nexports.Theme = Theme;\nclass ScopeStack {\n constructor(parent, scopeName) {\n this.parent = parent;\n this.scopeName = scopeName;\n }\n static from(...segments) {\n let result = null;\n for (let i = 0; i < segments.length; i++) {\n result = new ScopeStack(result, segments[i]);\n }\n return result;\n }\n push(scopeName) {\n return new ScopeStack(this, scopeName);\n }\n getSegments() {\n let item = this;\n const result = [];\n while (item) {\n result.push(item.scopeName);\n item = item.parent;\n }\n result.reverse();\n return result;\n }\n toString() {\n return this.getSegments().join(' ');\n }\n}\nexports.ScopeStack = ScopeStack;\nfunction _scopePathMatchesParentScopes(scopePath, parentScopes) {\n if (parentScopes === null) {\n return true;\n }\n let index = 0;\n let scopePattern = parentScopes[index];\n while (scopePath) {\n if (_matchesScope(scopePath.scopeName, scopePattern)) {\n index++;\n if (index === parentScopes.length) {\n return true;\n }\n scopePattern = parentScopes[index];\n }\n scopePath = scopePath.parent;\n }\n return false;\n}\nfunction _matchesScope(scopeName, scopePattern) {\n return scopePattern === scopeName || (scopeName.startsWith(scopePattern) && scopeName[scopePattern.length] === '.');\n}\nclass StyleAttributes {\n constructor(fontStyle, foregroundId, backgroundId) {\n this.fontStyle = fontStyle;\n this.foregroundId = foregroundId;\n this.backgroundId = backgroundId;\n }\n}\nexports.StyleAttributes = StyleAttributes;\n/**\n * Parse a raw theme into rules.\n */\nfunction parseTheme(source) {\n if (!source) {\n return [];\n }\n if (!source.settings || !Array.isArray(source.settings)) {\n return [];\n }\n let settings = source.settings;\n let result = [], resultLen = 0;\n for (let i = 0, len = settings.length; i < len; i++) {\n let entry = settings[i];\n if (!entry.settings) {\n continue;\n }\n let scopes;\n if (typeof entry.scope === 'string') {\n let _scope = entry.scope;\n // remove leading commas\n _scope = _scope.replace(/^[,]+/, '');\n // remove trailing commans\n _scope = _scope.replace(/[,]+$/, '');\n scopes = _scope.split(',');\n }\n else if (Array.isArray(entry.scope)) {\n scopes = entry.scope;\n }\n else {\n scopes = [''];\n }\n let fontStyle = -1 /* NotSet */;\n if (typeof entry.settings.fontStyle === 'string') {\n fontStyle = 0 /* None */;\n let segments = entry.settings.fontStyle.split(' ');\n for (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n let segment = segments[j];\n switch (segment) {\n case 'italic':\n fontStyle = fontStyle | 1 /* Italic */;\n break;\n case 'bold':\n fontStyle = fontStyle | 2 /* Bold */;\n break;\n case 'underline':\n fontStyle = fontStyle | 4 /* Underline */;\n break;\n case 'strikethrough':\n fontStyle = fontStyle | 8 /* Strikethrough */;\n break;\n }\n }\n }\n let foreground = null;\n if (typeof entry.settings.foreground === 'string' && utils_1.isValidHexColor(entry.settings.foreground)) {\n foreground = entry.settings.foreground;\n }\n let background = null;\n if (typeof entry.settings.background === 'string' && utils_1.isValidHexColor(entry.settings.background)) {\n background = entry.settings.background;\n }\n for (let j = 0, lenJ = scopes.length; j < lenJ; j++) {\n let _scope = scopes[j].trim();\n let segments = _scope.split(' ');\n let scope = segments[segments.length - 1];\n let parentScopes = null;\n if (segments.length > 1) {\n parentScopes = segments.slice(0, segments.length - 1);\n parentScopes.reverse();\n }\n result[resultLen++] = new ParsedThemeRule(scope, parentScopes, i, fontStyle, foreground, background);\n }\n }\n return result;\n}\nexports.parseTheme = parseTheme;\nclass ParsedThemeRule {\n constructor(scope, parentScopes, index, fontStyle, foreground, background) {\n this.scope = scope;\n this.parentScopes = parentScopes;\n this.index = index;\n this.fontStyle = fontStyle;\n this.foreground = foreground;\n this.background = background;\n }\n}\nexports.ParsedThemeRule = ParsedThemeRule;\nfunction fontStyleToString(fontStyle) {\n if (fontStyle === -1 /* NotSet */) {\n return 'not set';\n }\n let style = '';\n if (fontStyle & 1 /* Italic */) {\n style += 'italic ';\n }\n if (fontStyle & 2 /* Bold */) {\n style += 'bold ';\n }\n if (fontStyle & 4 /* Underline */) {\n style += 'underline ';\n }\n if (fontStyle & 8 /* Strikethrough */) {\n style += 'strikethrough ';\n }\n if (style === '') {\n style = 'none';\n }\n return style.trim();\n}\nexports.fontStyleToString = fontStyleToString;\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedThemeRules(parsedThemeRules, _colorMap) {\n // Sort rules lexicographically, and then by index if necessary\n parsedThemeRules.sort((a, b) => {\n let r = utils_1.strcmp(a.scope, b.scope);\n if (r !== 0) {\n return r;\n }\n r = utils_1.strArrCmp(a.parentScopes, b.parentScopes);\n if (r !== 0) {\n return r;\n }\n return a.index - b.index;\n });\n // Determine defaults\n let defaultFontStyle = 0 /* None */;\n let defaultForeground = '#000000';\n let defaultBackground = '#ffffff';\n while (parsedThemeRules.length >= 1 && parsedThemeRules[0].scope === '') {\n let incomingDefaults = parsedThemeRules.shift();\n if (incomingDefaults.fontStyle !== -1 /* NotSet */) {\n defaultFontStyle = incomingDefaults.fontStyle;\n }\n if (incomingDefaults.foreground !== null) {\n defaultForeground = incomingDefaults.foreground;\n }\n if (incomingDefaults.background !== null) {\n defaultBackground = incomingDefaults.background;\n }\n }\n let colorMap = new ColorMap(_colorMap);\n let defaults = new StyleAttributes(defaultFontStyle, colorMap.getId(defaultForeground), colorMap.getId(defaultBackground));\n let root = new ThemeTrieElement(new ThemeTrieElementRule(0, null, -1 /* NotSet */, 0, 0), []);\n for (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n let rule = parsedThemeRules[i];\n root.insert(0, rule.scope, rule.parentScopes, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n }\n return new Theme(colorMap, defaults, root);\n}\nclass ColorMap {\n constructor(_colorMap) {\n this._lastColorId = 0;\n this._id2color = [];\n this._color2id = Object.create(null);\n if (Array.isArray(_colorMap)) {\n this._isFrozen = true;\n for (let i = 0, len = _colorMap.length; i < len; i++) {\n this._color2id[_colorMap[i]] = i;\n this._id2color[i] = _colorMap[i];\n }\n }\n else {\n this._isFrozen = false;\n }\n }\n getId(color) {\n if (color === null) {\n return 0;\n }\n color = color.toUpperCase();\n let value = this._color2id[color];\n if (value) {\n return value;\n }\n if (this._isFrozen) {\n throw new Error(`Missing color in color map - ${color}`);\n }\n value = ++this._lastColorId;\n this._color2id[color] = value;\n this._id2color[value] = color;\n return value;\n }\n getColorMap() {\n return this._id2color.slice(0);\n }\n}\nexports.ColorMap = ColorMap;\nclass ThemeTrieElementRule {\n constructor(scopeDepth, parentScopes, fontStyle, foreground, background) {\n this.scopeDepth = scopeDepth;\n this.parentScopes = parentScopes;\n this.fontStyle = fontStyle;\n this.foreground = foreground;\n this.background = background;\n }\n clone() {\n return new ThemeTrieElementRule(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);\n }\n static cloneArr(arr) {\n let r = [];\n for (let i = 0, len = arr.length; i < len; i++) {\n r[i] = arr[i].clone();\n }\n return r;\n }\n acceptOverwrite(scopeDepth, fontStyle, foreground, background) {\n if (this.scopeDepth > scopeDepth) {\n console.log('how did this happen?');\n }\n else {\n this.scopeDepth = scopeDepth;\n }\n // console.log('TODO -> my depth: ' + this.scopeDepth + ', overwriting depth: ' + scopeDepth);\n if (fontStyle !== -1 /* NotSet */) {\n this.fontStyle = fontStyle;\n }\n if (foreground !== 0) {\n this.foreground = foreground;\n }\n if (background !== 0) {\n this.background = background;\n }\n }\n}\nexports.ThemeTrieElementRule = ThemeTrieElementRule;\nclass ThemeTrieElement {\n constructor(_mainRule, rulesWithParentScopes = [], _children = {}) {\n this._mainRule = _mainRule;\n this._children = _children;\n this._rulesWithParentScopes = rulesWithParentScopes;\n }\n static _sortBySpecificity(arr) {\n if (arr.length === 1) {\n return arr;\n }\n arr.sort(this._cmpBySpecificity);\n return arr;\n }\n static _cmpBySpecificity(a, b) {\n if (a.scopeDepth === b.scopeDepth) {\n const aParentScopes = a.parentScopes;\n const bParentScopes = b.parentScopes;\n let aParentScopesLen = aParentScopes === null ? 0 : aParentScopes.length;\n let bParentScopesLen = bParentScopes === null ? 0 : bParentScopes.length;\n if (aParentScopesLen === bParentScopesLen) {\n for (let i = 0; i < aParentScopesLen; i++) {\n const aLen = aParentScopes[i].length;\n const bLen = bParentScopes[i].length;\n if (aLen !== bLen) {\n return bLen - aLen;\n }\n }\n }\n return bParentScopesLen - aParentScopesLen;\n }\n return b.scopeDepth - a.scopeDepth;\n }\n match(scope) {\n if (scope === '') {\n return ThemeTrieElement._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));\n }\n let dotIndex = scope.indexOf('.');\n let head;\n let tail;\n if (dotIndex === -1) {\n head = scope;\n tail = '';\n }\n else {\n head = scope.substring(0, dotIndex);\n tail = scope.substring(dotIndex + 1);\n }\n if (this._children.hasOwnProperty(head)) {\n return this._children[head].match(tail);\n }\n return ThemeTrieElement._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));\n }\n insert(scopeDepth, scope, parentScopes, fontStyle, foreground, background) {\n if (scope === '') {\n this._doInsertHere(scopeDepth, parentScopes, fontStyle, foreground, background);\n return;\n }\n let dotIndex = scope.indexOf('.');\n let head;\n let tail;\n if (dotIndex === -1) {\n head = scope;\n tail = '';\n }\n else {\n head = scope.substring(0, dotIndex);\n tail = scope.substring(dotIndex + 1);\n }\n let child;\n if (this._children.hasOwnProperty(head)) {\n child = this._children[head];\n }\n else {\n child = new ThemeTrieElement(this._mainRule.clone(), ThemeTrieElementRule.cloneArr(this._rulesWithParentScopes));\n this._children[head] = child;\n }\n child.insert(scopeDepth + 1, tail, parentScopes, fontStyle, foreground, background);\n }\n _doInsertHere(scopeDepth, parentScopes, fontStyle, foreground, background) {\n if (parentScopes === null) {\n // Merge into the main rule\n this._mainRule.acceptOverwrite(scopeDepth, fontStyle, foreground, background);\n return;\n }\n // Try to merge into existing rule\n for (let i = 0, len = this._rulesWithParentScopes.length; i < len; i++) {\n let rule = this._rulesWithParentScopes[i];\n if (utils_1.strArrCmp(rule.parentScopes, parentScopes) === 0) {\n // bingo! => we get to merge this into an existing one\n rule.acceptOverwrite(scopeDepth, fontStyle, foreground, background);\n return;\n }\n }\n // Must add a new rule\n // Inherit from main rule\n if (fontStyle === -1 /* NotSet */) {\n fontStyle = this._mainRule.fontStyle;\n }\n if (foreground === 0) {\n foreground = this._mainRule.foreground;\n }\n if (background === 0) {\n background = this._mainRule.background;\n }\n this._rulesWithParentScopes.push(new ThemeTrieElementRule(scopeDepth, parentScopes, fontStyle, foreground, background));\n }\n}\nexports.ThemeTrieElement = ThemeTrieElement;\n//# sourceMappingURL=theme.js.map","\"use strict\";\n/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.performanceNow = exports.CachedFn = exports.escapeRegExpCharacters = exports.isValidHexColor = exports.strArrCmp = exports.strcmp = exports.RegexSource = exports.basename = exports.mergeObjects = exports.clone = void 0;\nfunction clone(something) {\n return doClone(something);\n}\nexports.clone = clone;\nfunction doClone(something) {\n if (Array.isArray(something)) {\n return cloneArray(something);\n }\n if (typeof something === 'object') {\n return cloneObj(something);\n }\n return something;\n}\nfunction cloneArray(arr) {\n let r = [];\n for (let i = 0, len = arr.length; i < len; i++) {\n r[i] = doClone(arr[i]);\n }\n return r;\n}\nfunction cloneObj(obj) {\n let r = {};\n for (let key in obj) {\n r[key] = doClone(obj[key]);\n }\n return r;\n}\nfunction mergeObjects(target, ...sources) {\n sources.forEach(source => {\n for (let key in source) {\n target[key] = source[key];\n }\n });\n return target;\n}\nexports.mergeObjects = mergeObjects;\nfunction basename(path) {\n const idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\\\');\n if (idx === 0) {\n return path;\n }\n else if (~idx === path.length - 1) {\n return basename(path.substring(0, path.length - 1));\n }\n else {\n return path.substr(~idx + 1);\n }\n}\nexports.basename = basename;\nlet CAPTURING_REGEX_SOURCE = /\\$(\\d+)|\\${(\\d+):\\/(downcase|upcase)}/g;\nclass RegexSource {\n static hasCaptures(regexSource) {\n if (regexSource === null) {\n return false;\n }\n CAPTURING_REGEX_SOURCE.lastIndex = 0;\n return CAPTURING_REGEX_SOURCE.test(regexSource);\n }\n static replaceCaptures(regexSource, captureSource, captureIndices) {\n return regexSource.replace(CAPTURING_REGEX_SOURCE, (match, index, commandIndex, command) => {\n let capture = captureIndices[parseInt(index || commandIndex, 10)];\n if (capture) {\n let result = captureSource.substring(capture.start, capture.end);\n // Remove leading dots that would make the selector invalid\n while (result[0] === '.') {\n result = result.substring(1);\n }\n switch (command) {\n case 'downcase':\n return result.toLowerCase();\n case 'upcase':\n return result.toUpperCase();\n default:\n return result;\n }\n }\n else {\n return match;\n }\n });\n }\n}\nexports.RegexSource = RegexSource;\nfunction strcmp(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\nexports.strcmp = strcmp;\nfunction strArrCmp(a, b) {\n if (a === null && b === null) {\n return 0;\n }\n if (!a) {\n return -1;\n }\n if (!b) {\n return 1;\n }\n let len1 = a.length;\n let len2 = b.length;\n if (len1 === len2) {\n for (let i = 0; i < len1; i++) {\n let res = strcmp(a[i], b[i]);\n if (res !== 0) {\n return res;\n }\n }\n return 0;\n }\n return len1 - len2;\n}\nexports.strArrCmp = strArrCmp;\nfunction isValidHexColor(hex) {\n if (/^#[0-9a-f]{6}$/i.test(hex)) {\n // #rrggbb\n return true;\n }\n if (/^#[0-9a-f]{8}$/i.test(hex)) {\n // #rrggbbaa\n return true;\n }\n if (/^#[0-9a-f]{3}$/i.test(hex)) {\n // #rgb\n return true;\n }\n if (/^#[0-9a-f]{4}$/i.test(hex)) {\n // #rgba\n return true;\n }\n return false;\n}\nexports.isValidHexColor = isValidHexColor;\n/**\n * Escapes regular expression characters in a given string\n */\nfunction escapeRegExpCharacters(value) {\n return value.replace(/[\\-\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&');\n}\nexports.escapeRegExpCharacters = escapeRegExpCharacters;\nclass CachedFn {\n constructor(fn) {\n this.fn = fn;\n this.cache = new Map();\n }\n get(key) {\n if (this.cache.has(key)) {\n return this.cache.get(key);\n }\n const value = this.fn(key);\n this.cache.set(key, value);\n return value;\n }\n}\nexports.CachedFn = CachedFn;\nexports.performanceNow = typeof performance === \"undefined\"\n // performance.now() is not available in this environment, so use Date.now()\n ? function () {\n return Date.now();\n }\n : function () {\n return performance.now();\n };\n//# sourceMappingURL=utils.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(787);\n"],"names":["root","factory","exports","module","define","amd","this","Object","defineProperty","value","UseOnigurumaFindOptions","DebugFlags","InDebugMode","process","env","EncodedTokenAttributes","toOptionalTokenType","toBinaryStr","encodedTokenAttributes","r","toString","length","print","languageId","getLanguageId","tokenType","getTokenType","fontStyle","getFontStyle","foreground","getForeground","background","getBackground","console","log","containsBalancedBrackets","set","_languageId","_tokenType","_containsBalancedBracketsBit","_fontStyle","_foreground","_background","standardType","BasicScopeAttributesProvider","BasicScopeAttributes","utils_1","constructor","initialLanguageId","embeddedLanguages","_getBasicScopeAttributes","CachedFn","scopeName","_scopeToLanguage","standardTokenType","_toStandardTokenType","_defaultAttributes","_embeddedLanguagesMatcher","ScopeMatcher","entries","getDefaultAttributes","getBasicScopeAttributes","_NULL_SCOPE_METADATA","get","scope","match","m","STANDARD_TOKEN_TYPE_REGEXP","Error","values","scopesRegExp","Map","escapedScopes","map","escapeRegExpCharacters","sort","reverse","RegExp","join","LineTokens","BalancedBracketSelectors","StateStack","AttributedScopeStack","Grammar","createGrammar","debug_1","encodedTokenAttributes_1","matcher_1","onigLib_1","rule_1","theme_1","basicScopesAttributeProvider_1","tokenizeString_1","collectInjections","result","selector","rule","ruleFactoryHelper","grammar","matchers","createMatchers","nameMatcher","ruleId","RuleFactory","getCompiledRuleId","repository","matcher","push","debugSelector","priority","identifers","scopes","lastIndex","every","identifier","i","scopesAreMatching","thisScopeName","len","substr","initialLanguage","tokenTypes","balancedBracketSelectors","grammarRepository","onigLib","_rootScopeName","_onigLib","_basicScopeAttributesProvider","_rootId","_lastRuleId","_ruleId2desc","_includedGrammars","_grammarRepository","_grammar","initGrammar","_injections","_tokenTypeMatchers","keys","type","themeProvider","dispose","createOnigScanner","sources","createOnigString","getMetadataForScope","_collectInjections","getExternalGrammar","rawInjections","injections","expression","injectionScopeNames","forEach","injectionScopeName","injectionGrammar","injectionSelector","i1","i2","getInjections","injection","registerRule","id","ruleIdFromNumber","getRule","ruleIdToNumber","rawIncludedGrammar","lookup","$base","tokenizeLine","lineText","prevState","timeLimit","_tokenize","tokens","lineTokens","getResult","ruleStack","lineLength","stoppedEarly","tokenizeLine2","getBinaryResult","emitBinaryTokens","isFirstLine","$self","NULL","reset","rawDefaultMetadata","defaultStyle","getDefaults","defaultMetadata","foregroundId","backgroundId","rootScopeName","getName","scopeList","createRootAndLookUpScopeName","createRoot","onigLineText","content","_tokenizeString","disposeOnigString","stack","base","clone","$vscodeTextmateLocation","patterns","name","parent","scopePath","tokenAttributes","static","ScopeStack","rawRootMetadata","rootStyle","themeMatch","resolvedTokenAttributes","mergeAttributes","equals","other","_equals","a","b","existingTokenAttributes","basicScopeAttributes","styleAttributes","pushAttributed","indexOf","_pushAttributed","split","target","rawMetadata","newPath","scopeThemeMatchResult","metadata","getScopeNames","getSegments","enterPos","anchorPos","beginRuleCapturedEOL","endRule","nameScopesList","contentNameScopesList","_stackElementBrand","undefined","depth","_enterPos","_anchorPos","_structuralEquals","el","_reset","pop","safePop","getEnterPos","getAnchorPos","_writeString","res","outIndex","withContentNameScopesList","contentNameScopeStack","withEndRule","hasSameRuleAs","balancedBracketScopes","unbalancedBracketScopes","allowAny","flatMap","matchesAlways","matchesNever","excluder","includer","tokenTypeOverrides","_emitBinaryTokens","_tokenTypeOverrides","_lineText","_tokens","_binaryTokens","_lastTokenEndIndex","produce","endIndex","produceFromScopes","scopesList","substring","replace","k","startIndex","Uint32Array","parseInclude","TopLevelRepositoryReference","TopLevelReference","RelativeReference","SelfReference","BaseReference","ScopeDependencyProcessor","ExternalReferenceCollector","TopLevelRepositoryRuleReference","TopLevelRuleReference","toKey","ruleName","_references","_seenReferenceKeys","Set","visitedRule","references","add","reference","key","has","collectReferencesOfReference","baseGrammarScopeName","repo","selfGrammar","baseGrammar","collectExternalReferencesInTopLevelRule","collectExternalReferencesInTopLevelRepositoryRule","context","collectExternalReferencesInRules","Array","isArray","rules","patternRepository","mergeObjects","include","kind","newContext","initialScopeName","seenFullScopeRequests","seenPartialScopeRequests","Q","processQueue","q","deps","dep","indexOfSharp","__createBinding","create","o","k2","enumerable","__exportStar","p","prototype","hasOwnProperty","call","LocalStackElement","TokenizeStringResult","linePos","checkWhileConditions","STOP","anchorPosition","whileCheckResult","whileRules","node","nodeRule","BeginWhileRule","whileRule","ruleScanner","findOptions","prepareRuleWhileSearch","findNextMatchSync","debugName","debugWhileRegExp","whileRuleId","captureIndices","start","handleCaptures","whileCaptures","end","_checkWhileConditions","startTime","Date","now","scanNext","matchResult","prepareRuleSearch","perfStart","performanceNow","elapsedMillis","warn","matchedRuleId","matchRule","injectionResult","bestMatchRuleId","bestMatchRating","Number","MAX_VALUE","bestMatchCaptureIndices","bestMatchResultPriority","matchRating","priorityMatch","matchInjections","matchResultScore","injectionResultScore","matchRuleOrInjections","hasAdvanced","endRuleId","poppedRule","debugEndRegExp","endCaptures","popped","error","_rule","beforePush","BeginEndRule","pushedRule","debugBeginRegExp","beginCaptures","contentName","getContentName","endHasBackReferences","getEndWithResolvedBackReferences","whileHasBackReferences","getWhileWithResolvedBackReferences","matchingRule","debugMatchRegExp","captures","endRegexSource","allowA","allowG","compile","getFindOptions","compileAG","compileWhile","compileWhileAG","options","lineTextContent","Math","min","localStack","maxEnd","captureRule","captureIndex","endPos","retokenizeCapturedWithRuleId","stackClone","onigSubStr","captureRuleScopeName","captureRuleScopesList","doFail","streamState","msg","pos","source","parseJSON","filename","withMetadata","JSONStreamState","token","JSONToken","state","cur","stateStack","objStack","pushState","popState","fail","nextJSONToken","toLocation","keyValue","parseFloat","newArr","newDict","line","char","offset","_state","_out","chCode","charCodeAt","_","m0","String","fromCodePoint","parseInt","parseRawGrammar","INITIAL","Registry","grammar_1","grammarReader","registry_1","grammarDependencies_1","_options","_syncRegistry","SyncRegistry","Theme","createFromRawTheme","theme","colorMap","_ensureGrammarCache","setTheme","getColorMap","loadGrammarWithEmbeddedLanguages","loadGrammarWithConfiguration","configuration","_loadGrammar","unbalancedBracketSelectors","loadGrammar","async","dependencyProcessor","Promise","all","request","_loadSingleGrammar","_grammarForScopeName","_doLoadSingleGrammar","addGrammar","rawGrammar","grammarForScopeName","isIdentifier","matchesName","results","tokenizer","input","regex","exec","next","newTokenizer","charAt","parseConjunction","parseOperand","expressionToNegate","matcherInput","expressionInParents","some","parseInnerExpression","identifiers","str","plist","json_1","filePath","test","contents","JSON","parse","parseWithLocation","parsePLIST","parsePLISTGrammar","_parse","locationKeyName","advancePosBy","by","advancePosTo","to","skipWhitespace","advanceIfStartsWith","advanceUntil","nextOccurence","captureUntil","curKey","newState","newCur","dictState","arrState","leaveDict","leaveArray","acceptString","val","acceptReal","isNaN","acceptInteger","acceptDate","acceptData","acceptBool","parseOpenTag","isClosed","trim","parseTagValue","tag","peekChCode","_onigLibPromise","_grammars","_rawGrammars","_injectionGrammars","_theme","targetScope","CompiledRule","RegExpSourceList","RegExpSource","IncludeOnlyRule","MatchRule","CaptureRule","Rule","HAS_BACK_REFERENCES","BACK_REFERENCING_END","Symbol","$location","_name","_nameIsCapturing","RegexSource","hasCaptures","_contentName","_contentNameIsCapturing","location","basename","replaceCaptures","super","collectPatterns","out","_match","_cachedCompiledPatterns","_getCachedCompiledPatterns","hasMissingPatterns","pattern","begin","applyEndPatternLast","_begin","_end","hasBackReferences","resolveBackReferences","unshift","setSource","_while","_cachedCompiledWhilePatterns","_getCachedCompiledWhilePatterns","helper","desc","_compileCaptures","_compilePatterns","while","maximumCaptureId","captureId","numericCaptureId","createCaptureRule","localIncludedRule","externalGrammarName","externalGrammarInclude","externalGrammar","externalIncludedRule","skipRule","regExpSource","lastPushedPos","output","hasAnchor","nextCh","_anchorCache","_buildAnchorCache","newSource","capturedValues","capture","g1","ch","A0_G0_result","A0_G1_result","A1_G0_result","A1_G1_result","A0_G0","A0_G1","A1_G0","A1_G1","resolveAnchors","_items","_hasAnchors","_cached","_disposeCaches","item","index","regExps","e","_resolveAnchors","scanner","string","startPosition","ThemeTrieElement","ThemeTrieElementRule","ColorMap","fontStyleToString","ParsedThemeRule","parseTheme","StyleAttributes","_colorMap","_defaults","_root","_cachedMatchRoot","createFromParsedTheme","parsedThemeRules","strcmp","strArrCmp","parentScopes","defaultFontStyle","defaultForeground","defaultBackground","incomingDefaults","shift","defaults","getId","insert","resolveParsedThemeRules","effectiveRule","find","v","scopePattern","_matchesScope","_scopePathMatchesParentScopes","segments","startsWith","settings","resultLen","entry","_scope","j","lenJ","isValidHexColor","slice","style","_lastColorId","_id2color","_color2id","_isFrozen","color","toUpperCase","scopeDepth","arr","acceptOverwrite","_mainRule","rulesWithParentScopes","_children","_rulesWithParentScopes","_cmpBySpecificity","aParentScopes","bParentScopes","aParentScopesLen","bParentScopesLen","aLen","bLen","_sortBySpecificity","concat","head","tail","dotIndex","_doInsertHere","child","cloneArr","doClone","something","cloneArray","obj","cloneObj","path","idx","lastIndexOf","CAPTURING_REGEX_SOURCE","regexSource","captureSource","commandIndex","command","toLowerCase","len1","len2","hex","fn","cache","performance","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}