KrikriJinja::Lexer
Constructors
Class methods
Single forward byte scan for the earliest of the three tag openers. Returns the char index of the opener and which opener matched, or nil when none remains. Replaces three separate String#index scans plus an array allocation per tag.
Finds the tag closer starting at start, skipping quoted strings and
balancing braces when the closer itself starts with "}".
Returns the tag's content end, whether it closed with a - strip
marker, and whether it closed with a + KEEP marker (Jinja2's
whitespace-control form that suppresses trim_blocks for that tag).
comment marks a COMMENT body, which Jinja2 never scans for string
literals or balanced braces: its comment rule is
\{#.*?(?:#\}|\Z) with DOTALL, so the first #} closes it however
the text between reads. Running the quote-skipping loop below on a
comment made an apostrophe ("Jinja currently doesn't have...") open a
string that ran past the #}, and the whole comment then failed as
unclosed "{#" tag (ableton.sccache's templates/config.j2).