fix bug affecting almost empty files
--HG-- branch : pmacs2
This commit is contained in:
parent
17ba41e335
commit
ada40b4224
3
lex3.py
3
lex3.py
|
@ -253,12 +253,13 @@ class RegionRule(Rule):
|
|||
# ok, so now loop over all the tokens in the current grammar, until
|
||||
# the stop-token (if any) is found, and return each result as we get
|
||||
# it.
|
||||
tok = None
|
||||
for tok in self._lex(lexer, toresume, tokname, stopre, grammar):
|
||||
yield tok
|
||||
|
||||
# ok, so now either we found the stop-token, and have a new parent
|
||||
# for future tokens (if any), or we are done.
|
||||
if tok.name == tokname:
|
||||
if tok is not None and tok.name == tokname:
|
||||
toresume = [tok]
|
||||
matchd.update(tok.matchd)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue