ReadonlyclassOptional ReadonlyfollowedThe class only applies when the text right after the match matches this
(also sticky). Kept out of pattern rather than written as a trailing
lookahead so that the scanner still learns how long the lexeme was when
the condition fails. A lookahead hides that, and the scanner then
re-tries every rule at every offset inside the same word, which is
quadratic on a long one.
Optional ReadonlykeywordsWhen set, the match only counts as this token if the captured text is a
keyword of the language, otherwise it falls through to otherwise.
Optional ReadonlyotherwiseReadonlypatternMust be sticky (y); matched at the current position only.
Language definitions for createHighlighter. Each is a small set of rules rather than a grammar: enough to colour code correctly in an editor, without pulling a parser into the bundle.
Rules are tried in order at each position, so the specific ones (comments, strings) must precede the general ones (identifiers).