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

ignore trailing newline tokens #2120

Merged
merged 1 commit into from Jul 26, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

When calculating the end offset for AST nodes, ignore trailing newlines.

How I did it

In some cases the final token given for an AST node is type 4, which is \n. This makes for a weird source offset, and under very specific conditions is causing issues in Brownie.

To fix it, I'm checking if the final token is \n and if yes: -1 from the given offset.

How to verify it

Run tests.

Cute Animal Picture

image

@fubuloubu fubuloubu merged commit 4c08391 into vyperlang:master Jul 26, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-offsets branch July 26, 2020 21:52
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.

None yet

2 participants