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

ast: revisit Modifiers #2958

Closed
Boshen opened this issue Apr 13, 2024 · 3 comments
Closed

ast: revisit Modifiers #2958

Boshen opened this issue Apr 13, 2024 · 3 comments
Assignees
Labels
A-ast Area - AST C-enhancement Category - New feature or request

Comments

@Boshen
Copy link
Member

Boshen commented Apr 13, 2024

The Modifiers data is used for error recoverable, but it causes a lot of confusion while working on the AST. Consider removing it.

@Boshen Boshen added the C-enhancement Category - New feature or request label Apr 13, 2024
@Boshen Boshen self-assigned this Apr 13, 2024
@Boshen Boshen changed the title fix(ast): revisit Modifiers ast: revisit Modifiers Apr 13, 2024
@Boshen Boshen added the A-ast Area - AST label Apr 13, 2024
@Boshen
Copy link
Member Author

Boshen commented Jun 15, 2024

I want a data structure to clearly indicate the allowed modifiers, with other disallowed modifiers attached to it.

@overlookmotel
Copy link
Contributor

overlookmotel commented Jun 19, 2024

Would it be OK to:

Only allow valid modifiers to be encoded in the AST.

When parser finds a modifier in an invalid location, it raises an error and then ignores it (i.e. doesn't put it in AST) and can then continue parsing the rest of the file.

Then we get a simpler AST which we can rely on being valid, but don't cause the parser to grind to a halt when it hits something illegal, and user still gets feedback about the invalid syntax.

Does that count as recoverable?

@Boshen
Copy link
Member Author

Boshen commented Jun 23, 2024

AST no longer uses Modifiers but parser still uses it for maximum control.

@Boshen Boshen closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST C-enhancement Category - New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants