mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
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).
This commit is contained in:
parent
331a726b38
commit
e1b82531b3
1 changed files with 4 additions and 3 deletions
|
|
@ -1252,10 +1252,11 @@ def is_start_line(self, line):
|
|||
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 @@ def is_stop_line(line):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue