Skip to content

Conversation

@timo
Copy link
Contributor

@timo timo commented Feb 26, 2025

Make the grammar faster and also correcter.

timo added 2 commits February 26, 2025 19:36
The fact that both xmldecl and doctypedecl were optional and had
the comment and pi tokens after them with a star, a failure to reach
the end of the file to get the $ to match, will shuffle match
attempts between the first and second line ...

One first step in making the parser fail faster when encountering
an invalid document.
Better from a performance standpoint because of less opportunities
to backtrack, but also prevents comments from including their stopper
and other stuff up until another comment or pi stopper is seen.
@timo timo marked this pull request as draft February 26, 2025 19:14
@timo timo mentioned this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants