Parse Trait (#71)

This commit is contained in:
Jeong, YunWon 2023-05-28 21:03:27 +09:00 committed by GitHub
parent 5493c9f4e3
commit 4de0cb1827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 278 additions and 97 deletions

View file

@ -60,7 +60,8 @@ Execution mode check. Allowed modes are `exec`, `eval` or `single`.
For example, one could do this:
```
use rustpython_parser::{parser, ast};
use rustpython_parser::{Parse, ast};
let python_source = "print('Hello world')";
let python_ast = parser::parse_expression(python_source).unwrap();
let python_statements = ast::Suite::parse(python_source).unwrap(); // statements
let python_expr = ast::Expr::parse(python_source).unwrap(); // or expr
```