Skip to content

Require word-breaks before gas, value, salt, etc #42

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

Merged
merged 1 commit into from
May 8, 2021
Merged

Conversation

haltman-at
Copy link
Collaborator

@haltman-at haltman-at commented May 5, 2021

In a few places, rather than relying on keywords and lexemes, we have regular expressions that begin with certain words. However, we didn't do anything to check that those words are occurring after a word-break.

For gas/value/salt I did this properly and also checked for dollar signs if negative lookbehind is available. (I also split that up a bit so it's easier to add more in the future if any more are ever added.)

For unicode and hex, I did things the lazy way and just used \b; after all, if you add something to the beginning of these, it's no longer valid syntax in the first place, so I think that's probably fine, assuming we're mostly concerned with valid syntax. But, obviously, I can go back and change that if this is considered to be a problem.

@haltman-at haltman-at requested a review from frangio May 5, 2021 19:26
@joshgoebel
Copy link
Member

I can't speak for you but the library itself does not concern itself with invalid syntax.

Copy link
Collaborator

@frangio frangio left a comment

Choose a reason for hiding this comment

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

LGTM!

@haltman-at haltman-at merged commit d75a911 into master May 8, 2021
@haltman-at haltman-at deleted the fix-special branch May 8, 2021 04:18
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.

3 participants