File tree 1 file changed +2
-9
lines changed 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,7 @@ pub fn parse_located(
93
93
location : Location ,
94
94
) -> Result < ast:: Mod , ParseError > {
95
95
let lxr = lexer:: make_tokenizer_located ( source, location) ;
96
- let marker_token = ( Default :: default ( ) , mode. to_marker ( ) , Default :: default ( ) ) ;
97
- let tokenizer = iter:: once ( Ok ( marker_token) )
98
- . chain ( lxr)
99
- . filter_ok ( |( _, tok, _) | !matches ! ( tok, Tok :: Comment { .. } | Tok :: NonLogicalNewline ) ) ;
100
-
101
- python:: TopParser :: new ( )
102
- . parse ( tokenizer)
103
- . map_err ( |e| crate :: error:: parse_error_from_lalrpop ( e, source_path) )
96
+ parse_tokens ( lxr, mode, source_path)
104
97
}
105
98
106
99
// Parse a given token iterator.
@@ -112,7 +105,7 @@ pub fn parse_tokens(
112
105
let marker_token = ( Default :: default ( ) , mode. to_marker ( ) , Default :: default ( ) ) ;
113
106
let tokenizer = iter:: once ( Ok ( marker_token) )
114
107
. chain ( lxr)
115
- . filter_ok ( |( _, tok, _) | !matches ! ( tok, Tok :: Comment ( _ ) ) ) ;
108
+ . filter_ok ( |( _, tok, _) | !matches ! ( tok, Tok :: Comment { .. } | Tok :: NonLogicalNewline ) ) ;
116
109
117
110
python:: TopParser :: new ( )
118
111
. parse ( tokenizer)
You can’t perform that action at this time.
0 commit comments