mirror of
https://github.com/gryf/pythonhelper.git
synced 2025-12-18 20:10:24 +01:00
Use a zipper instead of counting by hand.
This commit is contained in:
@@ -178,14 +178,11 @@ class SimplePythonTagsParser(object):
|
||||
|
||||
# initalize local auxiliary variables {{{
|
||||
tagsStack = []
|
||||
lineNumber = 0
|
||||
# }}}
|
||||
|
||||
import itertools
|
||||
# go through all the lines in the source and localize all Python tags in it {{{
|
||||
for line in self.source:
|
||||
|
||||
# increase line number
|
||||
lineNumber += 1
|
||||
for (line, lineNumber) in zip(self.source, itertools.count(1)):
|
||||
|
||||
# extract the line's indentation characters and its content {{{
|
||||
lineMatch = self.COMMENTS_INDENT_RE.match(line)
|
||||
|
||||
Reference in New Issue
Block a user