Function python_ast::parser::parse
source · pub fn parse<'a>(input: &'a str, filename: &str) -> PyResult<Module>
Expand description
Takes a string of bytes and returns the Python-tokenized version of it. use python_ast::parse;
fn read_python_file(input: std::path::Path) {
let py = read_to_string(input).unwrap();
let ast = parse(&py, "__main__").unwrap();
println!("{:?}", ast);
}