Upgrade RustPython (#4747)

This commit is contained in:
Micha Reiser 2023-05-31 10:26:35 +02:00 committed by GitHub
parent 06bcb85f81
commit 6c1ff6a85f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 104 additions and 93 deletions

View file

@ -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(())
}