You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavaScript in the fancy-regex syntax set never finishes on a two-line input #166
With two-face 0.5.2+bat-0.26.1 (syntect-fancy) and syntect 5.3.0, the syntax named JavaScript in the fancy set does not return from ParseState::parse_line on this input:
|{type: "a"}/** x */
The second line runs for minutes at flat memory. An onig-linked syntect build, with the
syntax selected by name, hangs the same way, so the cause is in the definition, not in the
regex engine.
Cause: expression-statement-continuation matches empty (the / of /* is in its operator
class), and the "rest of the line is blanks and comments" rule also matches empty; the two set each other forever. syntect's loop guard only catches non-consuming pushes
(trishume/syntect#706 diagnoses this; #460 is the older report).
sublimehq/Packages fixed the definition in #3257 (2022-11), but that fix uses branch_point,
which syntect 5.3.0 cannot load. bat avoids the hang by mapping js to JavaScript (Babel),
which the fancy set excludes. So a fancy-set user who resolves js by token gets the
looping definition.
Possible ways out, your call: note it in the README's fancy-set legend, or ship a patched JavaScript in the fancy set that drops the empty match.
Activity