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

feat[lang]: native hex string literals #4271

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Oct 4, 2024

What I did

Resolves #4206

How I did it

Add a custom parser to watch for STRING tokens whenever there is a NAME tokens of "x" value, store the location of these hex literals, and transform them to byte values during transformation of the python ast to vyper ast.

How to verify it

See new tests.

Commit message

feat: native hex string literals

This PR adds a custom parser to track the locations
of native hex literals, which are converted to byte
values during transformation of the python ast to
vyper ast.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@tserg tserg changed the title feat: native hex string literals feat[lang]: native hex string literals Oct 4, 2024
@@ -48,7 +48,7 @@ def validate_version_pragma(version_str: str, full_source_code: str, start: Pars
)


class ForParserState(enum.Enum):
class CustomParserState(enum.Enum):
Copy link
Member

Choose a reason for hiding this comment

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

maybe just ParserState

@charles-cooper
Copy link
Member

please add docs!

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.

VIP: native hex string literals
2 participants