diff --git a/application.py b/application.py index d439fe3..c90c5fe 100755 --- a/application.py +++ b/application.py @@ -699,6 +699,11 @@ class Application(object): token_done = x_offset + len(s) <= slot.width token_wrap = x_offset + len(s) > slot.width attr = color.build(*token.color) + #xyz + #if hasattr(token, 'resume') and token.resume: + # attr = color.build('blue', 'green') + #else: + # attr = color.build(*token.color) self.win.addstr(slot.offset + count, x_offset, s[:slot.width - x_offset], attr) if token_wrap: diff --git a/lex.py b/lex.py index 6c67857..97c7ecc 100755 --- a/lex.py +++ b/lex.py @@ -13,6 +13,7 @@ class Token(object): self.parent = parent self.matchd = matchd self.link = link + #self.resume = False #xyz assert parent is None or hasattr(parent, 'name'), 'oh no %r' % parent def parents(self): if self.parent is not None: @@ -238,8 +239,6 @@ class RegionRule(Rule): del lexer.mode.gstack[fqname] else: mode = lexer.mode - # XYZ - #grammar = self.pairs[i][0] if self.pairs[i][0] is not None: grammar = self.pairs[i][0] else: @@ -408,8 +407,10 @@ class Lexer(object): if toresume: for t in toresume[0].rule.resume(self, toresume): + #t.resume = True #xyz yield t for t in self._lex(): + #t.resume = True #xyz yield t del self.action raise StopIteration