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

Add duplicate arguments check #8

Merged
merged 1 commit into from
Aug 13, 2022
Merged

Add duplicate arguments check #8

merged 1 commit into from
Aug 13, 2022

Conversation

charliermarsh
Copy link
Member

No description provided.

@charliermarsh charliermarsh merged commit 290b009 into main Aug 13, 2022
@charliermarsh charliermarsh deleted the charlie/duplicates branch August 13, 2022 18:20
charliermarsh added a commit that referenced this pull request Feb 14, 2023
charliermarsh added a commit that referenced this pull request Feb 14, 2023
charliermarsh added a commit that referenced this pull request Feb 14, 2023
charliermarsh added a commit that referenced this pull request Feb 14, 2023
charliermarsh added a commit that referenced this pull request Feb 14, 2023
charliermarsh added a commit that referenced this pull request Feb 15, 2023
charliermarsh added a commit that referenced this pull request Feb 15, 2023
MichaReiser pushed a commit that referenced this pull request Jul 27, 2023
MichaReiser pushed a commit that referenced this pull request Jul 27, 2023
## Summary

This PR adds `TextRange` to `Identifier`. Right now, the AST only
includes ranges for identifiers in certain cases (`Expr::Name`,
`Keyword`, etc.), namely when the identifier comprises an entire AST
node. In Ruff, we do additional ad-hoc lexing to extract identifiers
from source code.

One frequent example: given a function `def f(): ...`, we lex to find
the range of `f`, for use in diagnostics.

Another: `except ValueError as e`, for which the AST doesn't include a
range for `e`.

Note that, as an optimization, we avoid storing the `TextRange` for
`Expr::Name`, since it's already included.
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.

1 participant