Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case-insensitive PUSH / PEEK / POP #541

Open
mdharm opened this issue Sep 25, 2021 · 0 comments
Open

Case-insensitive PUSH / PEEK / POP #541

mdharm opened this issue Sep 25, 2021 · 0 comments

Comments

@mdharm
Copy link

mdharm commented Sep 25, 2021

For certain grammars, it would be helpful if PUSH(), PEEK, and POP all had case-insensitive variants. The HTML grammar used by the html_parser crate is one example; it does not properly parse sequences such as <BODY></body> and there is no "easy" fix -- this is partially a side-effect of the grammar being written to accept arbitrary tags (rather than limiting to only the well-defined HTML tags such as), so it does not explicitly list all of the valid tag tokens. Instead, it uses PUSH() and POP to find matching opening / closing tags.

I'm sure there are other cases where this would be handy. It doesn't look like a major effort either, as there is already a case-insensitive comparison method Position::match_insensitive() that could be used in place of the existing Position::match_string()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants