Large buffer of non C++ text results in RangeError: Maximum call stack size exceeded #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
Using the C++ parser in Codemirror together with a large buffer of HTML text results in a
RangeError: Maximum call stack size exceedederror.The following code in the Try Codemirror reproduces the error:
I understand that this is not proper use of the C++ parser, and I don't expect it to produce good syntax highlighting for that content, but I guess that it still shouldn't throw an exception. I imagine it could cause issues for an editor that lets the user manually change the current language if they accidentally chooses C++ for a large HTML-file.
It seems
github.com/lezer-parser/lr@84bb8aaf89wasn't quite strict enough. Attached patch reduces the limit, which seems to resolve this (released as @lezer/lr 1.3.2).