Upgrade RustPython (#4747)
This commit is contained in:
@@ -5,7 +5,8 @@ use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Result;
|
||||
use rustpython_parser as parser;
|
||||
use rustpython_parser::ast::Suite;
|
||||
use rustpython_parser::Parse;
|
||||
|
||||
#[derive(clap::Args)]
|
||||
pub(crate) struct Args {
|
||||
@@ -16,7 +17,7 @@ pub(crate) struct Args {
|
||||
|
||||
pub(crate) fn main(args: &Args) -> Result<()> {
|
||||
let contents = fs::read_to_string(&args.file)?;
|
||||
let python_ast = parser::parse_program(&contents, &args.file.to_string_lossy())?;
|
||||
let python_ast = Suite::parse(&contents, &args.file.to_string_lossy())?;
|
||||
println!("{python_ast:#?}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user