diff options
author | Larry Hastings <larry@hastings.org> | 2014-07-27 14:22:20 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-07-27 14:22:20 (GMT) |
commit | e1b82531b32295604eacd27faeb87431c426bd52 (patch) | |
tree | c7d902b0c6aa19e951bdd8d2a5be571e948ee9c0 /Tools | |
parent | 331a726b38b290bdd3193052f0f9b6e32821a260 (diff) | |
download | cpython-e1b82531b32295604eacd27faeb87431c426bd52.zip cpython-e1b82531b32295604eacd27faeb87431c426bd52.tar.gz cpython-e1b82531b32295604eacd27faeb87431c426bd52.tar.bz2 |
Argument Clinic bugfix: Don't let the C preprocessor "Monitor" see lines
that we are scanning for the output marker. If we don't find it, we will
scan them again, so it sees them twice, and it can get confused (like
thinking we're still in a comment).
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/clinic/clinic.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 93e8f5a..d15318e 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -1252,10 +1252,11 @@ class BlockParser: match = self.start_re.match(line.lstrip()) return match.group(1) if match else None - def _line(self): + def _line(self, lookahead=False): self.line_number += 1 line = self.input.pop() - self.language.parse_line(line) + if not lookahead: + self.language.parse_line(line) return line def parse_verbatim_block(self): @@ -1311,7 +1312,7 @@ class BlockParser: output_add, output_output = text_accumulator() arguments = None while self.input: - line = self._line() + line = self._line(lookahead=True) match = checksum_re.match(line.lstrip()) arguments = match.group(1) if match else None if arguments: |