Mercurial > python-compiler.rs
comparison src/main.rs @ 13:38b0d63697b1
Import the full AST grammar from CPython 3.5.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 02 Jun 2016 05:33:23 +0100 |
parents | fa7e285f88e7 |
children | 25b202005d1d |
comparison
equal
deleted
inserted
replaced
12:0e96c5bc401d | 13:38b0d63697b1 |
---|---|
3 mod python_tb; | 3 mod python_tb; |
4 mod python_parse; | 4 mod python_parse; |
5 mod python_dump; | 5 mod python_dump; |
6 mod python_ast; | 6 mod python_ast; |
7 mod ast_convert; | 7 mod ast_convert; |
8 mod ast_scope; | |
9 mod ast_dump; | 8 mod ast_dump; |
9 //mod ast_scope; | |
10 //mod ast_rewrite; | 10 //mod ast_rewrite; |
11 //mod ast_type; | 11 //mod ast_type; |
12 | 12 |
13 use std::fs::File; | 13 use std::fs::File; |
14 use std::io::Read; | 14 use std::io::Read; |
48 }; | 48 }; |
49 | 49 |
50 //python_dump::dump_module(&module); | 50 //python_dump::dump_module(&module); |
51 let module_ast = ast_convert::convert_ast("__main__".to_string(), &module); | 51 let module_ast = ast_convert::convert_ast("__main__".to_string(), &module); |
52 ast_dump::dump_ast(&module_ast); | 52 ast_dump::dump_ast(&module_ast); |
53 let scoped_ast = ast_scope::scope_ast(vec!(module_ast)); | 53 //let scoped_ast = ast_scope::scope_ast(vec!(module_ast)); |
54 println!("{:#?}", scoped_ast); | 54 //println!("{:#?}", scoped_ast); |
55 //let new_scoped_ast = ast_scope::check_scoping(scoped_ast); | |
56 //println!("{:#?}", new_scoped_ast); | |
55 //ast_rewrite::rewrite_ast(module_ast); | 57 //ast_rewrite::rewrite_ast(module_ast); |
56 //ast_type::type_ast(scoped_ast); | 58 //ast_type::type_ast(scoped_ast); |
57 } | 59 } |