Most likely I did something dumb, but to be honest I don't know what, because I don't really know the grammars theory.
Trying nearley in playground, but this one constantly causing error "Possible infinite loop detected! Check your grammar for infinite recursion."
DATA -> FONT_MODIFIER | COLOR_MODIFIER | TEXT
TEXT -> [^\n\^\&]:+
FONT_MODIFIER -> "&" [iIbBsS] {% ([_, value]) => ({ type: "font", value }) %}
COLOR_MODIFIER -> "^" [aAbBcCdDfFgGiIkKmMoOpPrRsSwWyYnN] {% ([_, value]) => ({ type: "color", value }) %}
Most likely I did something dumb, but to be honest I don't know what, because I don't really know the grammars theory. Trying nearley in playground, but this one constantly causing error "Possible infinite loop detected! Check your grammar for infinite recursion."
Am I doing something wrong or it is a bug?