ruff/crates
Dhruv Manilawala 025768d303
Add Tokens newtype wrapper, TokenKind iterator (#11361)
## Summary

Alternative to #11237 

This PR adds a new `Tokens` struct which is a newtype wrapper around a
vector of lexer output. This allows us to add a `kinds` method which
returns an iterator over the corresponding `TokenKind`. This iterator is
implemented as a separate `TokenKindIter` struct to allow using the type
and provide additional methods like `peek` directly on the iterator.

This exposes the linter to access the stream of `TokenKind` instead of
`Tok`.

Edit: I've made the necessary downstream changes and plan to merge the
entire stack at once.
2024-05-14 16:45:04 +00:00
..
red_knot Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_benchmark Use tokenize for linter benchmark (#11417) 2024-05-14 10:28:40 -04:00
ruff_cache Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_dev Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_diagnostics Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_formatter Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_linter Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_macros Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_notebook Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_ast Implement IntoIterator for FStringElements (#11410) 2024-05-13 16:24:49 +00:00
ruff_python_ast_integration_tests Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_codegen Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_formatter Add Python 3.13 to list of allowed Python versions (#11411) 2024-05-13 16:35:41 +00:00
ruff_python_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_literal Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_parser Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_stdlib Add Python 3.13 to list of allowed Python versions (#11411) 2024-05-13 16:35:41 +00:00
ruff_python_trivia Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_trivia_integration_tests Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_server Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_source_file Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_workspace Add Python 3.13 to list of allowed Python versions (#11411) 2024-05-13 16:35:41 +00:00