@@ -204,7 +204,8 @@ def parse(self, expr, simplify=False):
204
204
if TRACE_PARSE :
205
205
tokenized = list (tokenized )
206
206
print ('tokens:' )
207
- map (print , tokenized )
207
+ for t in tokenized :
208
+ print (t )
208
209
tokenized = iter (tokenized )
209
210
210
211
# the abstract syntax tree for this expression that will be build as we
@@ -262,16 +263,16 @@ def is_operator(_t):
262
263
if TRACE_PARSE : print (' ast: token_type is TOKEN_NOT:' , repr (ast ))
263
264
264
265
elif token_type == TOKEN_AND :
265
- # if not prev_token or not is_sym(prev_token_type):
266
- # raise ParseError(token_type, token_string, token_position, PARSE_INVALID_OPERATOR_SEQUENCE)
266
+ # if not prev_token or not is_sym(prev_token_type):
267
+ # raise ParseError(token_type, token_string, token_position, PARSE_INVALID_OPERATOR_SEQUENCE)
267
268
268
269
ast = self ._start_operation (ast , self .AND , precedence )
269
270
if TRACE_PARSE :
270
271
print (' ast:token_type is TOKEN_AND: start_operation' , ast )
271
272
272
273
elif token_type == TOKEN_OR :
273
- # if not prev_token or not is_sym(prev_token_type):
274
- # raise ParseError(token_type, token_string, token_position, PARSE_INVALID_OPERATOR_SEQUENCE)
274
+ # if not prev_token or not is_sym(prev_token_type):
275
+ # raise ParseError(token_type, token_string, token_position, PARSE_INVALID_OPERATOR_SEQUENCE)
275
276
276
277
ast = self ._start_operation (ast , self .OR , precedence )
277
278
if TRACE_PARSE :
0 commit comments