/*

For the reasoning behind this please see:
https://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419

*/

/*
      Why might be find ourselves here?  An potential end match that was
      triggered but could not be completed.  IE, `doEndMatch` returned NO_MATCH.
      (this could be because a callback requests the match be ignored, etc)

      This causes no real harm other than stopping a few times too many.
      */

/*
    Created to solve the key deficiently with MultiRegex - there is no way to
    test for multiple matches at a single location.  Why would we need to do
    that?  In the future a more dynamic engine will allow certain matches to be
    ignored.  An example: if we matched say the 3rd regex in a large group but
    decided to ignore it - we'd need to started testing again at the 4th
    regex... but MultiRegex itself gives us no real way to do that.

    So what this class creates MultiRegexs on the fly for whatever search
    position they are needed.

    NOTE: These additional MultiRegex objects are created dynamically.  For most
    grammars most of the time we will never actually need anything more than the
    first MultiRegex - so this shouldn't have too much overhead.

    Say this is our search group, and we match regex3, but wish to ignore it.

      regex1 | regex2 | regex3 | regex4 | regex5    ' ie, startAt = 0

    What we need is a new MultiRegex that only includes the remaining
    possibilities:

      regex4 | regex5                               ' ie, startAt = 3

    This class wraps all that complexity up in a simple API... `startAt` decides
    where in the array of expressions to start doing the matching. It
    auto-increments, so if a match is found at position 2, then startAt will be
    set to 3.  If the end is reached startAt will return to 0.

    MOST of the time the parser will be setting startAt manually to 0.
  */

/*
Language: JSON
Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Website: http://www.json.org
Category: common, protocols, web
*/

/*
Syntax highlighting with language autodetection.
https://highlightjs.org/
*/

/* Interface definition */

/* Utility functions */

/* eslint-disable no-multi-assign */

/* harmony default export */

/*#__PURE__*/

/**
     *  Process an individual match
     *
     * @param {string} textBeforeMatch - text preceding the match (since the last match)
     * @param {EnhancedMatch} [match] - the match itself
     */

/**
     * @param {CompiledMode } mode - the mode to potentially end
     * @param {RegExpMatchArray} match - the latest match
     * @param {string} matchPlusRemainder - match plus remainder of content
     * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode
     */

/**
     * @param {CompiledMode} mode - new mode to start
     * @param {RegExpMatchArray} match
     */

/**
     * @param {CompiledScope} scope
     * @param {RegExpMatchArray} match
     */

/**
     * @param {string} text
     * @param {string} scope
     */

/**
     * Handle matching but then ignoring a sequence of text
     *
     * @param {string} lexeme - string containing full match text
     */

/**
     * Handle the potential end of mode
     *
     * @param {RegExpMatchArray} match - the current match
     */

/**
     * Handle the start of a new potential mode match
     *
     * @param {EnhancedMatch} match - the current match
     * @returns {number} how far to advance the parse cursor
     */

/**
     * Return keyword data if a match is a keyword
     * @param {CompiledMode} mode - current mode
     * @param {string} matchText - the textual match
     * @returns {KeywordData | false}
     */

/**
    Stores multiple regular expressions and allows you to quickly search for
    them all in a string simultaneously - returning the first match.  It does
    this by creating a huge (a|b|c) regex - each individual item wrapped with ()
    and joined by `|` - using match groups to track position.  When a match is
    found checking which position in the array has content allows us to figure
    out which of the original regexes / match groups triggered the match.

    The match object itself (the result of `Regex.exec`) is returned but also
    enhanced by merging in any meta-data that was registered with the regex.
    This is how we keep track of which mode matched, and what type of rule
    (`illegal`, `begin`, end, etc).
  */

/**
   *
   * @param {PluginEvent} event
   * @param {any} args
   */

/**
   *
   * @param {string|string[]} aliasList - single alias or list of aliases
   * @param {{languageName: string}} opts
   */

/**
   * @param {*} options
   */

/**
   * @param {CompiledMode} mode
   */

/**
   * @param {Emitter & {root: DataNode}} emitter
   * @param {string} name
   */

/**
   * @param {HLJSPlugin} plugin
   */

/**
   * @param {HighlightedHTMLElement} block - the HTML element to determine language for
   */

/**
   * @param {Node} node
   */

/**
   * @param {Renderer} builder
   * @param {Node} node
   */

/**
   * @param {string} name - name of the language to retrieve
   * @returns {Language | undefined}
   */

/**
   * @param {string} text
   */

/**
   * @returns {string[]} List of language internal names
   */

/**
   * @typedef { import("./html_renderer").Renderer } Renderer
   * @param {Renderer} builder
   */

/**
   * Adds a node close to the output stream (if needed)
   *
   * @param {Node} node */

/**
   * Adds a node open to the output stream (if needed)
   *
   * @param {Node} node */

/**
   * Adds texts to the output stream
   *
   * @param {string} text */

/**
   * Applies highlighting to a DOM node containing code.
   *
   * @param {HighlightedHTMLElement} element - the HTML element to highlight
  */

/**
   * Builds a regex with the case sensitivity of the current language
   *
   * @param {RegExp | string} value
   * @param {boolean} [global]
   */

/**
   * Builds a span element
   *
   * @param {string} className */

/**
   * Builds new class name for block given the language name
   *
   * @param {HTMLElement} element
   * @param {string} [currentLang]
   * @param {string} [resultLang]
   */

/**
   * Compiles an individual list of keywords
   *
   * Ex: "for if when while|5"
   *
   * @param {string} scopeName
   * @param {Array<string>} keywordList
   */

/**
   * Compiles an individual mode
   *
   * This can raise an error if the mode contains certain detectable known logic
   * issues.
   * @param {Mode} mode
   * @param {CompiledMode | null} [parent]
   * @returns {CompiledMode | never}
   */

/**
   * Core highlighting function.
   *
   * OLD API
   * highlight(lang, code, ignoreIllegals, continuation)
   *
   * NEW API
   * highlight(code, {lang, ignoreIllegals})
   *
   * @param {string} codeOrLanguageName - the language to use for highlighting
   * @param {string | HighlightOptions} optionsOrCode - the code to highlight
   * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
   *
   * @returns {HighlightResult} Result - an object that represents the result
   * @property {string} language - the language name
   * @property {number} relevance - the relevance score
   * @property {string} value - the highlighted HTML code
   * @property {string} code - the original raw code
   * @property {CompiledMode} top - top of the current mode stack
   * @property {boolean} illegal - indicates whether any illegal matches were found
  */

/**
   * Creates a new HTMLRenderer
   *
   * @param {Tree} parseTree - the parse tree (must support `walk` API)
   * @param {{classPrefix: string}} options
   */

/**
   * DEPRECATED
   * @param {HighlightedHTMLElement} el
   */

/**
   * Determines if a given language has auto-detection enabled
   * @param {string} name - name of the language
   */

/**
   * Given a mode, builds a huge ResumableMultiRegex that can be used to walk
   * the content and find matches.
   *
   * @param {CompiledMode} mode
   * @returns {ResumableMultiRegex}
   */

/**
   * Register a language grammar module
   *
   * @param {string} languageName
   * @param {LanguageFn} languageDefinition
   */

/**
   * Remove a language grammar module
   *
   * @param {string} languageName
   */

/**
   * Tests a language name to see if highlighting should be skipped
   * @param {string} languageName
   */

/**
   * Updates highlight.js global options with the passed options
   *
   * @param {Partial<HLJSOptions>} userOptions
   */

/**
   * Upgrades the old highlightBlock plugins to the new
   * highlightElement API
   * @param {HLJSPlugin} plugin
   */

/**
   * auto-highlights all pre>code elements on the page
   */

/**
   * private highlight that's used internally and does not fire callbacks
   *
   * @param {string} languageName - the language to use for highlighting
   * @param {string} codeToHighlight - the code to highlight
   * @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
   * @param {CompiledMode?} [continuation] - current continuation mode, if any
   * @returns {HighlightResult} - result of the highlight operation
  */

/**
   * returns a valid highlight result, without actually doing any actual work,
   * auto highlight starts with this and it's possible for small snippets that
   * auto-detection may not find a better match
   * @param {string} code
   * @returns {HighlightResult}
   */

/**
   * returns the accumulated buffer
  */

/**
  Currently this is all private API, but this is the minimal API necessary
  that an Emitter must implement to fully support the parser.

  Minimal interface:

  - addText(text)
  - __addSublanguage(emitter, subLanguageName)
  - startScope(scope)
  - endScope()
  - finalize()
  - toHTML()

*/

/**
  Highlighting with language detection. Accepts a string with the code to
  highlight. Returns an object with the following properties:

  - language (detected language)
  - relevance (int)
  - value (an HTML string with highlighting markup)
  - secondBest (object with the same structure for second-best heuristically
    detected language, may be absent)

    @param {string} code
    @param {Array<string>} [languageSubset]
    @returns {AutoHighlightResult}
  */

/**
 *
 * @type {CompilerExt}
 */

/**
 * @implements {Emitter}
 */

/**
 * @param { Array<string | RegExp | Object> } args
 * @returns {object}
 */

/**
 * @param {(string | RegExp)[]} regexps
 * @param {{joinWith: string}} opts
 * @returns {string}
 */

/**
 * @param {...(RegExp | string) } args
 * @returns {string}
 */

/**
 * @param {CompiledMode} mode
 */

/**
 * @param {RegExp | string } re
 * @returns {string}
 */

/**
 * @param {RegExp | string} re
 * @returns {number}
 */

/**
 * @param {string} message
 */

/**
 * @param {string} value
 * @returns {RegExp}
 * */

/**
 * @param {string} value
 * @returns {string}
 */

/**
 * @type {Record<string, boolean>}
 */

/**
 * @typedef {object} Renderer
 * @property {(text: string) => void} addText
 * @property {(node: Node) => void} openNode
 * @property {(node: Node) => void} closeNode
 * @property {() => string} value
 */

/**
 * Allow `illegal` to contain an array of illegal values
 * @type {CompilerExt}
 */

/**
 * Any of the passed expresssions may match
 *
 * Creates a huge this | this | that | that match
 * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args
 * @returns {string}
 */

/**
 * Compiles a language definition result
 *
 * Given the raw result of a language definition (Language), compiles this so
 * that it is ready for highlighting code.
 * @param {Language} language
 * @returns {CompiledLanguage}
 */

/**
 * Determines if a given keyword is common or not
 *
 * @param {string} keyword */

/**
 * Determines if a mode has a dependency on it's parent or not
 *
 * If a mode does have a parent dependency then often we need to clone it if
 * it's used in multiple places so that each copy points to the correct parent,
 * where-as modes without a parent can often safely be re-used at the bottom of
 * a mode chain.
 *
 * @param {Mode | null} mode
 * @returns {boolean} - is there a dependency on the parent?
 * */

/**
 * Determines if a node needs to be wrapped in <span>
 *
 * @param {Node} node */

/**
 * Does lexeme start with a regular expression match at the beginning
 * @param {RegExp} re
 * @param {string} lexeme
 */

/**
 * Expands a mode or clones it if necessary
 *
 * This is necessary for modes with parental dependenceis (see notes on
 * `dependencyOnParent`) and for nodes that have `variants` - which must then be
 * exploded into their own individual modes at compile time.
 *
 * @param {Mode} mode
 * @returns {Mode | Mode[]}
 * */

/**
 * Given raw keywords from a language definition, compile them.
 *
 * @param {string | Record<string,string|string[]> | Array<string>} rawKeywords
 * @param {boolean} caseInsensitive
 */

/**
 * Renumbers labeled scope names to account for additional inner match
 * groups that otherwise would break everything.
 *
 * Lets say we 3 match scopes:
 *
 *   { 1 => ..., 2 => ..., 3 => ... }
 *
 * So what we need is a clean match like this:
 *
 *   (a)(b)(c) => [ "a", "b", "c" ]
 *
 * But this falls apart with inner match groups:
 *
 * (a)(((b)))(c) => ["a", "b", "b", "b", "c" ]
 *
 * Our scopes are now "out of alignment" and we're repeating `b` 3 times.
 * What needs to happen is the numbers are remapped:
 *
 *   { 1 => ..., 2 => ..., 5 => ... }
 *
 * We also need to know that the ONLY groups that should be output
 * are 1, 2, and 5.  This function handles this behavior.
 *
 * @param {CompiledMode} mode
 * @param {Array<RegExp | string>} regexes
 * @param {{key: "beginScope"|"endScope"}} opts
 */

/**
 * Returns the proper score for a given keyword
 *
 * Also takes into account comment keywords, which will be scored 0 UNLESS
 * another score has been manually assigned.
 * @param {string} keyword
 * @param {string} [providedScore]
 */

/**
 * Skip a match if it has a preceding dot
 *
 * This is used for `beginKeywords` to prevent matching expressions such as
 * `bob.keyword.do()`. The mode compiler automatically wires this up as a
 * special _internal_ 'on:begin' callback for modes with `beginKeywords`
 * @param {RegExpMatchArray} match
 * @param {CallbackResponse} response
 */

/**
 * `beginKeywords` syntactic sugar
 * @type {CompilerExt}
 */

/**
 * `match` to match a single expression for readability
 * @type {CompilerExt}
 */

/**
 * performs a shallow merge of multiple objects into one
 *
 * @template T
 * @param {T} original
 * @param {Record<string,any>[]} objects
 * @returns {T} a single new object
 */

/**
 * provides the default 1 relevance to all modes
 * @type {CompilerExt}
 */

/**
 * this exists only to allow `scope: {}` to be used beside `match:`
 * Otherwise `beginScope` would necessary and that would look weird

  {
    match: [ /def/, /\w+/ ]
    scope: { 1: "keyword" , 2: "title" }
  }

 * @param {CompiledMode} mode
 */

/**
@typedef {import('highlight.js').CallbackResponse} CallbackResponse
@typedef {import('highlight.js').CompilerExt} CompilerExt
*/

/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').CompiledScope} CompiledScope
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSApi} HLJSApi
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').PluginEvent} PluginEvent
@typedef {import('highlight.js').HLJSOptions} HLJSOptions
@typedef {import('highlight.js').LanguageFn} LanguageFn
@typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement
@typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext
@typedef {import('highlight.js/private').MatchType} MatchType
@typedef {import('highlight.js/private').KeywordData} KeywordData
@typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch
@typedef {import('highlight.js/private').AnnotatedError} AnnotatedError
@typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult
@typedef {import('highlight.js').HighlightOptions} HighlightOptions
@typedef {import('highlight.js').HighlightResult} HighlightResult
*/

/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').CompiledLanguage} CompiledLanguage
*/

/**  */

/** */

/** @implements CallbackResponse */

/** @param {Node} node */

/** @param {string} s */

/** @param {string} scope */

/** @returns {DataNode} */

/** @type CompiledMode */

/** @type DataNode */

/** @type HLJSOptions */

/** @type HTMLElement */

/** @type HighlightResult */

/** @type Mode */

/** @type Node */

/** @type Record<number,boolean> */

/** @type Record<string,CompiledMode> */

/** @type Record<string,any> */

/** @type { object & {capture?: boolean} }  */

/** @type {AnnotatedError} */

/** @type {BeforeHighlightContext} */

/** @type {CompiledMode} */

/** @type {Language} */

/** @type {ModeCallback} */

/** @type {Record<string, Language>} */

/** @type {Record<string, string>} */

/** @type {RegExp | string} */

/** @type {Renderer} */

/** @type {T} */

/** @type {import("highlight.js/private").KeywordDict} */

/** @type {{type?: MatchType, index?: number, rule?: Mode}}} */

/** @typedef { {capture?: boolean} } RegexEitherOptions */

/** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */

/** @typedef {import('highlight.js').CompiledMode} CompiledMode */

/** @typedef {import('highlight.js').Emitter} Emitter */

/** @typedef {import('highlight.js').ModeCallback} ModeCallback */

/** @typedef {import('highlight.js').Mode} Mode */

/** @typedef {{scope?: string, language?: string, children: Node[]} | string} Node */

/** @typedef {{scope?: string, language?: string, children: Node[]} } DataNode */

/** @typedef {{scope?: string, language?: string, sublanguage?: boolean}} Node */

/** @typedef {{walk: (r: Renderer) => void}} Tree */

/** skip vs abort vs ignore
   *
   * @skip   - The mode is still entered and exited normally (and contains rules apply),
   *           but all content is held and added to the parent buffer rather than being
   *           output when the mode ends.  Mostly used with `sublanguage` to build up
   *           a single large buffer than can be parsed by sublanguage.
   *
   *             - The mode begin ands ends normally.
   *             - Content matched is added to the parent mode buffer.
   *             - The parser cursor is moved forward normally.
   *
   * @abort  - A hack placeholder until we have ignore.  Aborts the mode (as if it
   *           never matched) but DOES NOT continue to match subsequent `contains`
   *           modes.  Abort is bad/suboptimal because it can result in modes
   *           farther down not getting applied because an earlier rule eats the
   *           content but then aborts.
   *
   *             - The mode does not begin.
   *             - Content matched by `begin` is added to the mode buffer.
   *             - The parser cursor is moved forward accordingly.
   *
   * @ignore - Ignores the mode (as if it never matched) and continues to match any
   *           subsequent `contains` modes.  Ignore isn't technically possible with
   *           the current parser implementation.
   *
   *             - The mode does not begin.
   *             - Content matched by `begin` is ignored.
   *             - The parser cursor is not moved forward.
   */

/******/

/***/

//

//     /--- resume first regex match here (for [number])

//     vv

//     |/---- full match here for [string, "booger", number]

//   follow the '(' with a '?'.

//   interesting elements

// "plaintext" stand-in so that the code blocks will still get normal

// "programming" type syntax) this gives us a strong signal that we've

// **INTERNAL** Not intended for outside usage

// - [...] elements, where the meaning of parentheses and escapes change

// - non-matching or lookahead parentheses, which do not capture. These

// - other escape sequences, so we do not misparse escape sequences as

// ---

// ------

// ....booger....

// 1. Match "booger" first, ignore. Also proves that [string] does non match.

// 2. Resume matching for [number]

// 3. Match at index + 1 for [string, "booger", number]

// 4. If #2 and #3 result in matches, which came first?

// @ts-ignore

// Adjust the backreference.

// BACKREF_RE matches an open parenthesis or backreference. To avoid

// CLONE

// CONCATENATED MODULE: ./node_modules/highlight.js/es/core.js

// CONCATENATED MODULE: ./node_modules/highlight.js/es/languages/json.js

// CONCATENATED MODULE: ./src/main/frontend/src/debuginfo/src/index.ts

// CONCATENATED MODULE: ./src/main/frontend/src/debuginfo/src/js/highlight.ts

// Common regexps

// Counting embedded language score towards the host language may be disabled

// EXPAND

// EXTERNAL MODULE: ./node_modules/highlight.js/lib/core.js

// Freeze prop if it is an object or function and also not already frozen

// Freeze self

// Global internal variables used within the highlight.js library.

// Global options used when within external APIs. This is modified when

// Grammar extensions / plugins

// Grammar extensions allow "syntactic sugar" to be added to the grammar modes

// It's possible to find something that LOOKS like the start of the

// Ref: https://github.com/highlightjs/highlight.js/issues/2140

// SAME position for only: [string, number] but ignoring "booger" (if it

// See: https://github.com/highlightjs/highlight.js/issues/2833

// So what we do: We execute two matchers, one resuming at the same

// TODO: Remove with v12 API

// TODO: We need negative look-behind support to do this properly

// TODO: how to include ", (, ) without breaking grammars that use these for

// TODO: remove v12, deprecated

// TODO: remove with v12

// TODO: remove with version 11.0

// TRULY found a comment - vs perhaps scanning with the wrong language.

// The following is because we have no easy way to say "resume scanning at the

// Which ever results in a match first is then used. So this 3-4 step

// _ implied for relevance only, do not highlight

// __beforeBegin is considered private API, internal use only

// `begin` when it runs.  Ie, no features have been added, but we've just made

// `compileMatch` being the perfect small example of now allowing a grammar

// `no-way`, etc.

// a 0 width match but not a begin/end match so it's not caught by the

// a before plugin can usurp the result completely by providing it's own

// a prior rule that was ignored".

// a word boundary is not sufficient, so instead we check for a word boundary

// add non-matched text to the current mode buffer

// advance so we aren't stuck in an infinite loop

// all prior rules are also skipped which can result in matching the wrong

// allow beforeMatch to act as a "qualifier" for the match

// allows XML everywhere and makes every XML snippet to have a much larger Markdown

// always award the tie to the base language

// an HTML injection attack - it's likely too late if this is already in

// an incorrect parse, it additionally matches the following:

// at this point modeBuffer should just be the match

// author to write `match` when they desire to match a single expression rather

// avoids the need to check length every time exec is called

// backreferences so they continue to match.

// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/

// beginScope just wraps the begin match itself in a scope

// beta configuration options, subject to change, welcome to discuss

// by applying a class name

// calling the `hljs.configure` function.

// check https://github.com/wooorm/lowlight/issues/47

// collapse all our objects back into the parent object

// comment - but then if there is no readable text - good chance it is a

// comment delimiters?

// common variable name

// compilation

// considered for a potential match

// console.log("match", match[0], match.rule && match.rule.begin)

// contractions - can't we'd they're let's, etc

// css classes applied to them - and one bad language won't break the

// decent number of iterations yet our index (cursor position in our

// default to 1 relevance if not specified

// delete node.children;

// different parents without issue

// do this early so compiler extensions generally don't have to worry about

// do this later so compiler extensions that come earlier have access to the

// doesn't allow spaces in keywords anyways and we still check for the boundary

// edge case for when illegal matches $ (end of line) which is technically

// entire highlighter

// eslint-disable-next-line no-undefined

// even if a single syntax or parse hits a fatal error

// even if on:end fires an `ignore` it's still possible

// excludes method names from keyword processing

// existing position but also skip the current rule ONLY". What happens is

// false match and not a comment.

// far looking only for "number", ignoring potential string matches (or

// first

// first handler (when ignoreIllegals is true)

// for a visual example please see:

// for languages with keywords that include non-word characters checking for

// future "booger" matches that might be valid.)

// give it a temporary name if it doesn't have one in the meta-data

// hack to avoid the space from being included. the space is necessary to

// hard or soft error

// have historically been settled, ie the language that comes first always

// helpers

// https://github.com/highlightjs/highlight.js/issues/1086

// https://github.com/highlightjs/highlight.js/issues/2827

// https://github.com/highlightjs/highlight.js/issues/3149

// https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards

// ie if C++ and Arduino are tied, it's more likely to be C++

// if "booger" is ignored then we'd really need a regex to scan from the

// if a highlight was requested before DOM was loaded, do now

// if we are called too early in the loading process

// if we have dependencies on parents then we need a unique

// if we have variants then essentially "replace" the mode with the variants

// illegal match, we do not continue processing

// in which case we don't even need to call highlight

// infinite loops are BAD, this is a last ditch catch all. if we have a

// input can be a string of keywords, an array of keywords, or a object with

// instance of ourselves, so we can be reused with many

// is currently an exercise for the caller. :-)

// it also places each individual regular expression into it's own

// join logically computes regexps.join(separator), but fixes the

// just be changing the object it was passed

// keep continuations for sub-languages

// keywords that should have no default relevance value

// language-* takes precedence over non-prefixed class names.

// languages that have serious errors are replaced with essentially a

// list of common 1 and 2 letter words in English

// looking like plain text, more likely to be a comment

// make sure the event listener is only added once

// manual scores always win over common keywords

// match at this very spot

// match group, keeping track of the sequencing of those match groups

// match groups that make up the multi-matcher)

// match here to prevent the plain text rule below from gobbling up doctags

// merge all the modes/regexes into our main object

// more likely to be caught in development before making it to production

// named keys representing scopeName (which can then point to a string or array)

// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */

// no more regexes to potentially match here, so we move the cursor forward one

// no need to move the cursor, we still have additional regexes to try and

// no special dependency issues, just return ourselves

// node.text = node.children.join("");

// note: this is not an exhaustive list of contractions, just popular ones

// old API

// only regexes not matched previously will now be

// or whitespace - this does no harm in any case since our keyword engine

// otherwise say they are equal, which has the effect of sorting on

// our matcher is [string, "booger", number]

// output from inside match groups

// parsing) still 3x behind our index then something is very wrong

// pass

// plaintext is always an option

// position, but the second full matcher starting at the position after:

// prevents double relevance, the keywords themselves provide

// process essentially allows us to say "match at this position, excluding

// production (the code has likely already done its damage by the time

// raw array if they wanted to perhaps manipulate it, etc.

// relevance while preserving the original ordering - which is how ties

// relevance, the mode doesn't need to double it

// return TokenTree._walk(builder, this.rootNode);

// returns a new instance of the highlighter to be used for extensions

// rule is not matched multiple times

// safe/production mode - swallows more errors, tries to keep running

// score.

// self is not valid at the top-level

// simple scope

// so we bail

// so we can't go deleting $pattern from the original on the first

// so you can force a score of 1 if you really insist

// sometimes they can end up matching nothing at all

// sort base on relevance

// space

// spit the "skipped" character that our regex choked on back into the output sequence

// starts conflicts with endsParent which we need to make sure the child

// sub-language

// than being forced to use `begin`.  The extension then just moves `match` into

// that we might trigger the end node because of a parent mode

// the distinction between match/begin

// the experience of writing (and reading grammars) a little bit nicer.

// the full match begin must be [beforeMatch][begin]

// the plugin can change anything in result to suite it

// the plugin can change the desired language or the code to be highlighted

// thing. Example of matching "booger":

// this does not

// this happens in compileMode, where this function is called from

// this happens when we have badly behaved rules that have optional matchers to the degree that

// this tries to find sequences of 3 english words in a row (without any

// this works

// tiered scope: comment.line

// trim off any earlier non-relevant match groups (ie, the other regex

// use the second matcher result

// was the first match), a simple resume would scan ahead who knows how

// we need a copy because keywords might be compiled multiple times

// we need a null object, which inherit will guarantee

// we should be all text, no child nodes (unescaped HTML) - this is possibly

// we use _emit to keep track of which match groups are "top-level" to avoid double

// we're seeing it)... but we yell loudly about this so that hopefully it's

// we've found a 0 width match and we're stuck, so we need to advance

// webpackRuntimeModules

// wins in the case of a tie

// with zeroing the containing mode relevance. Use case in point is Markdown that

// without requiring any underlying changes to the compiler internals.

// wrap-around to considering all matches again
