File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2941,7 +2941,8 @@ impl ToU32 for usize {
2941
2941
#[ cfg( test) ]
2942
2942
mod tests {
2943
2943
use super :: * ;
2944
- use rustpython_parser as parser;
2944
+ use rustpython_parser:: ast:: Suite ;
2945
+ use rustpython_parser:: Parse ;
2945
2946
use rustpython_parser_core:: source_code:: LinearLocator ;
2946
2947
2947
2948
fn compile_exec ( source : & str ) -> CodeObject {
@@ -2952,7 +2953,7 @@ mod tests {
2952
2953
"source_path" . to_owned ( ) ,
2953
2954
"<module>" . to_owned ( ) ,
2954
2955
) ;
2955
- let ast = parser :: parse_program ( source, "<test>" ) . unwrap ( ) ;
2956
+ let ast = Suite :: parse ( source, "<test>" ) . unwrap ( ) ;
2956
2957
let ast = locator. fold ( ast) . unwrap ( ) ;
2957
2958
let symbol_scope = SymbolTable :: scan_program ( & ast) . unwrap ( ) ;
2958
2959
compiler. compile_program ( & ast, symbol_scope) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ extern crate env_logger;
12
12
extern crate log;
13
13
14
14
use clap:: { App , Arg } ;
15
- use rustpython_parser:: { self as parser, ast} ;
15
+ use rustpython_parser:: { self as parser, ast, Parse } ;
16
16
use std:: {
17
17
path:: Path ,
18
18
time:: { Duration , Instant } ,
@@ -85,8 +85,8 @@ fn parse_python_file(filename: &Path) -> ParsedFile {
85
85
} ,
86
86
Ok ( source) => {
87
87
let num_lines = source. lines ( ) . count ( ) ;
88
- let result = parser :: parse_program ( & source , & filename . to_string_lossy ( ) )
89
- . map_err ( |e| e. to_string ( ) ) ;
88
+ let result =
89
+ ast :: Suite :: parse ( & source , & filename . to_string_lossy ( ) ) . map_err ( |e| e. to_string ( ) ) ;
90
90
ParsedFile {
91
91
// filename: Box::new(filename.to_path_buf()),
92
92
// code: source.to_string(),
You can’t perform that action at this time.
0 commit comments