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

Consolidate RE_EUNSUPPORTED syntax errors #473

Merged
merged 3 commits into from
May 30, 2024
Merged

Conversation

katef
Copy link
Owner

@katef katef commented May 30, 2024

We used to have two errors about unsupported situations found during AST analysis:

	RE_EUNSUPCAPTUR =  4 | RE_MISC,
	RE_EUNSUPPPCRE  =  5 | RE_MISC,

These are more specific than we need for a caller, and give a maintenance burden for when more would be introduced. So in this PR I'm rolling them up under the more general RE_EUNSUPPORTED case.

Any similar future ones can go under there too.

Now those two did not have an associated token (that is, they do not have | RE_MARK). But RE_EUNSUPPORTED does. So in this PR I am also providing a position for the error (which is why I did #471 first).

I'm blaming the entire string for this case (and would do for any other errors found through AST analysis), because we also construct ASTs from .fsm syntax. So it doesn't make sense to have AST nodes track lexical tokens for source position, because there isn't always a source.

@katef katef force-pushed the kate/consolidate-unsupported branch from c47df4c to c95d514 Compare May 30, 2024 14:51
My thinking here is that we don't need to categorise these independently from anything else we consider unsupported, because to the caller the reason something is unsupported doesn't matter. This way there's only one situation for a caller to keep track of, and in particular to not need to remember to update whenever we introduce more unsupported things.
@katef katef force-pushed the kate/consolidate-unsupported branch from 3eec4f9 to 5592b40 Compare May 30, 2024 14:59
@katef katef force-pushed the kate/consolidate-unsupported branch from 5592b40 to 61772d0 Compare May 30, 2024 15:01
@katef katef merged commit 201637d into main May 30, 2024
322 checks passed
@katef katef deleted the kate/consolidate-unsupported branch May 30, 2024 15:46
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