Skip to content

Commit

Permalink
Fixed bug related to state changes and ignored characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeaz committed Nov 27, 2007
1 parent 0e94b20 commit c31c713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ply/lex.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def clone(self,object=None):
c.lexoptimize = self.lexoptimize
c.lexliterals = self.lexliterals
c.lexmodule = self.lexmodule

# If the object parameter has been supplied, it means we are attaching the
# lexer to a new object. In this case, we have to rebind all methods in
# the lexstatere and lexstateerrorf tables.
Expand Down Expand Up @@ -302,6 +302,7 @@ def token(self):
# Every function must return a token, if nothing, we just move to next token
if not newtok:
lexpos = self.lexpos # This is here in case user has updated lexpos.
lexignore = self.lexignore # This is here in case there was a state change
break

# Verify type of the token. If not in the token map, raise an error
Expand Down

0 comments on commit c31c713

Please sign in to comment.