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

Allow parsers to manually return errors #3071

Open
ObserverOfTime opened this issue Feb 24, 2024 · 0 comments
Open

Allow parsers to manually return errors #3071

ObserverOfTime opened this issue Feb 24, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@ObserverOfTime
Copy link
Member

Problem

HTML and XML need to return error nodes when finding mismatched tag names. Parsers like readline need to prevent errors from affecting other lines. Aliasing nodes to $.ERROR does not construct an actual error symbol under the hood.

Expected behavior

This could either be implemented as a special case to alias() where alias($.foo, $.ERROR) wraps $.foo in an error symbol, or as a new function error([node]) which will wrap the node or directly return an error if called without one.

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

No branches or pull requests

2 participants