Function parse

Source
pub fn parse(
    input: impl AsRef<str>,
    filename: impl AsRef<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);
}