Open rscarson opened 6 months ago
Groups are never capturing in logos so you don't need ?:
, and you don't need groups around |
, so string literal can be rewritten as #[regex(r#""([^"\\]|\\.)*""#)]
. If that still overflows try #[regex(r#""([^"\\]+|\\.)*""#)]
. I believe it loops internally by doing tail call recursion so the greedily looping all non-escaped non-quote characters inside the group could help (but I have not tested it).
This is one of those cases that really needs the codegen rewrite (#291) into a loop with enum branching working as faux-goto instead of function calls.
I had already rewritten it as #[regex(r#""([^"\\]|\\.)*""#)]
with no luck but #[regex(r#""([^"\\]+|\\.)*""#)]
did the trick!
Thanks!
it still overflows at some point though, at a larger number
Should I leave this issue open for tracking?
Should I leave this issue open for tracking?
Ye, let's do that.
I have a StringLiteral token with the following expressions on it:
And encountering a string literal above ~20,000 characters stack overflows within logos generated code Is there an error in one of these expressions?