mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +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
|
@ -6,6 +6,7 @@ use std::path::PathBuf;
|
|||
|
||||
use anyhow::Result;
|
||||
use rustpython_parser::lexer;
|
||||
use rustpython_parser::mode::Mode;
|
||||
|
||||
#[derive(clap::Args)]
|
||||
pub struct Args {
|
||||
|
@ -16,7 +17,7 @@ pub struct Args {
|
|||
|
||||
pub fn main(args: &Args) -> Result<()> {
|
||||
let contents = fs::read_to_string(&args.file)?;
|
||||
for (_, tok, _) in lexer::make_tokenizer(&contents).flatten() {
|
||||
for (_, tok, _) in lexer::make_tokenizer(&contents, Mode::Module).flatten() {
|
||||
println!("{tok:#?}");
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue