mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-22 20:45:11 +00:00
Avoid match statement misidentification in token rules (#3129)
This commit is contained in:
parent
df3932f750
commit
1efa2e07ad
25 changed files with 128 additions and 66 deletions
|
@ -7,7 +7,7 @@ use rustpython_parser::{lexer, parser};
|
|||
/// Collect tokens up to and including the first error.
|
||||
pub fn tokenize(contents: &str) -> Vec<LexResult> {
|
||||
let mut tokens: Vec<LexResult> = vec![];
|
||||
for tok in lexer::make_tokenizer(contents) {
|
||||
for tok in lexer::make_tokenizer(contents, Mode::Module) {
|
||||
let is_err = tok.is_err();
|
||||
tokens.push(tok);
|
||||
if is_err {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue