-
Notifications
You must be signed in to change notification settings - Fork 71
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
chore: throw error with duplicated destination labels #308
base: stage
Are you sure you want to change the base?
chore: throw error with duplicated destination labels #308
Conversation
Hey, thank you for doing this! |
The example in ERC721 is common throughout a lot of contracts in huffmate, another larger bit of work would involve namespacing the labels further to the macro in which they are defined in, such that we address them |
I see, that makes total sense! That feature feels more advanced, but i'm happy to give it a go. Besides throwing an error if there is a duplicated label within a namespace, if we were to go that route, how would you handle a scenario such as this one? #295 (comment)
would u raise an out-of-scope error as the user would be trying to invoke a jumpdest for a label which had been defined in another macro (namespace)? |
As suggested by @iFrostizz on discord, I’ve removed the labels hashmap and moved towards caching labels directly within the Will try to work on the label namespacing over the weekend. |
Overview
This PR addresses issue #295 and aims to fulfill the feature requests made by @erhant and @Philogy.
Proposed Changes
ParserErrorKind::DuplicateLabel(String)
.Caveats
test_erc721_compile
currently fails due to non-unique labels (error
andcont
) inhuff-examples/erc721/contracts/ERC721.huff
.ERC721.huff
should be renamed for uniqueness.Impact
ERC721.huff
to ensure all tests pass with the new label uniqueness constraints.