Indent body of _EXAMPLE_RE for readability. _IS_BLANK_OR_COMMENT makes
more sense as a callable.
This commit is contained in:
parent
78b58f38f1
commit
d40a92b3f0
@ -601,7 +601,7 @@ class Parser:
|
|||||||
.*$\n? # But any other line
|
.*$\n? # But any other line
|
||||||
)*)
|
)*)
|
||||||
''', re.MULTILINE | re.VERBOSE)
|
''', re.MULTILINE | re.VERBOSE)
|
||||||
_IS_BLANK_OR_COMMENT = re.compile('^[ ]*(#.*)?$')
|
_IS_BLANK_OR_COMMENT = re.compile('^[ ]*(#.*)?$').match
|
||||||
|
|
||||||
def get_examples(self):
|
def get_examples(self):
|
||||||
"""
|
"""
|
||||||
@ -638,7 +638,7 @@ class Parser:
|
|||||||
|
|
||||||
# Extract source/want from the regexp match.
|
# Extract source/want from the regexp match.
|
||||||
(source, want) = self._parse_example(m, lineno)
|
(source, want) = self._parse_example(m, lineno)
|
||||||
if self._IS_BLANK_OR_COMMENT.match(source):
|
if self._IS_BLANK_OR_COMMENT(source):
|
||||||
continue
|
continue
|
||||||
examples.append( Example(source, want, lineno) )
|
examples.append( Example(source, want, lineno) )
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user