DebugClients/Python/coverage/parser.py

branch
Py2 comp.
changeset 3515
1b8381afe38f
parent 3499
f2d4b02c7e88
child 4385
599681bf149a
equal deleted inserted replaced
3506:d85fadb263a0 3515:1b8381afe38f
668 else: 668 else:
669 bang = "" 669 bang = ""
670 return "<%d+%d @%d%s %r>" % ( 670 return "<%d+%d @%d%s %r>" % (
671 self.byte, self.length, self.line, bang, list(self.exits) 671 self.byte, self.length, self.line, bang, list(self.exits)
672 ) 672 )
673
674
675 class CachedTokenizer(object): 673 class CachedTokenizer(object):
676 """A one-element cache around tokenize.generate_tokens. 674 """A one-element cache around tokenize.generate_tokens.
677 675
678 When reporting, coverage.py tokenizes files twice, once to find the 676 When reporting, coverage.py tokenizes files twice, once to find the
679 structure of the file, and once to syntax-color it. Tokenizing is 677 structure of the file, and once to syntax-color it. Tokenizing is
696 ) 694 )
697 return self.last_tokens 695 return self.last_tokens
698 696
699 # Create our generate_tokens cache as a callable replacement function. 697 # Create our generate_tokens cache as a callable replacement function.
700 generate_tokens = CachedTokenizer().generate_tokens 698 generate_tokens = CachedTokenizer().generate_tokens
699
700 #
701 # eflag: FileType = Python2

eric ide

mercurial