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

Consider "gap" between tokens for range query #11610

Merged
merged 2 commits into from
May 30, 2024

Conversation

dhruvmanila
Copy link
Member

Summary

This PR updates the methods on Tokens struct to consider the "gap" between tokens. Additionally, it adds a constraint to the methods which is that the offsets shouldn't be within the token range otherwise it'll panic.

Test Plan

Add unit test cases.

@dhruvmanila dhruvmanila added the parser Related to the parser label May 30, 2024
crates/ruff_python_parser/src/lib.rs Outdated Show resolved Hide resolved
crates/ruff_python_parser/src/lib.rs Outdated Show resolved Hide resolved
crates/ruff_python_parser/src/lib.rs Outdated Show resolved Hide resolved
crates/ruff_python_parser/src/lib.rs Outdated Show resolved Hide resolved
crates/ruff_python_parser/src/lib.rs Outdated Show resolved Hide resolved
@AlexWaygood AlexWaygood removed their request for review May 30, 2024 07:41
@dhruvmanila dhruvmanila merged commit d7b180d into dhruv/parser-phase-2 May 30, 2024
2 of 15 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/tokens-range-query branch May 30, 2024 10:05
dhruvmanila added a commit that referenced this pull request May 31, 2024
## Summary

This PR updates the methods on `Tokens` struct to consider the "gap"
between tokens. Additionally, it adds a constraint to the methods which
is that the offsets shouldn't be within the token range otherwise it'll
panic.

## Test Plan

Add unit test cases.
dhruvmanila added a commit that referenced this pull request Jun 3, 2024
## Summary

This PR updates the methods on `Tokens` struct to consider the "gap"
between tokens. Additionally, it adds a constraint to the methods which
is that the offsets shouldn't be within the token range otherwise it'll
panic.

## Test Plan

Add unit test cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Related to the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants