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

validate num. variants in enum declaration #120

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

0xalpharush
Copy link
Contributor

implements "enums must have at least 1 variant and no more than 256" from #29

@0xalpharush
Copy link
Contributor Author

0xalpharush commented Nov 14, 2024

The failure is due to not failing at parsing and during AST validation instead. It's odd as #121 is passing and solc succeeds parsing that case. Will need to decide whether to allow error resilient parsing or try to maintain parity with solc. IMO keeping all of this in the semantic stage makes sense for IDE, formatting, etc

@DaniPopes
Copy link
Member

DaniPopes commented Nov 18, 2024

Yeah I agree, it's unfortunate that in solc the 0 check is in the parser while the >256 check is done later, since both are allowed by the grammar. I think it's fine to ignore the failing test in here with a comment pointing to this PR

| "invalid_utf8_sequence"
) {

@0xalpharush 0xalpharush force-pushed the feat/enum-ast-validation branch from 3b004e5 to 7b1302e Compare November 18, 2024 14:48
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DaniPopes DaniPopes merged commit cea63c1 into paradigmxyz:main Nov 18, 2024
11 checks passed
@0xalpharush 0xalpharush deleted the feat/enum-ast-validation branch November 18, 2024 21:09
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