diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 6eb2c550e696fc..527b178edba08f 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -4666,9 +4666,9 @@ def state_dsl_start(self, line: str) -> None: fail(str(e)) return - self.next(self.state_modulename_name, line) + self.parse_modulename_name(line) - def state_modulename_name(self, line: str) -> None: + def parse_modulename_name(self, line: str) -> None: # looking for declaration, which establishes the leftmost column # line should be # modulename.fnname [as c_basename] [-> return annotation] @@ -4685,9 +4685,6 @@ def state_modulename_name(self, line: str) -> None: # this line is permitted to start with whitespace. # we'll call this number of spaces F (for "function"). - if not self.valid_line(line): - return - self.indent.infer(line) # are we cloning? @@ -4896,7 +4893,10 @@ def state_parameter(self, line: str) -> None: if indent == 1: # we indented, must be to new parameter docstring column - return self.next(self.state_parameter_docstring_start, line) + assert self.indent.margin is not None + self.parameter_docstring_indent = len(self.indent.margin) + assert self.indent.depth == 3 + return self.next(self.state_parameter_docstring, line) line = line.rstrip() if line.endswith('\\'): @@ -5278,12 +5278,6 @@ def parse_slash(self, function: Function) -> None: "positional-only parameters, which is unsupported.") p.kind = inspect.Parameter.POSITIONAL_ONLY - def state_parameter_docstring_start(self, line: str) -> None: - assert self.indent.margin is not None, "self.margin.infer() has not yet been called to set the margin" - self.parameter_docstring_indent = len(self.indent.margin) - assert self.indent.depth == 3 - return self.next(self.state_parameter_docstring, line) - def docstring_append(self, obj: Function | Parameter, line: str) -> None: """Add a rstripped line to the current docstring.""" matches = re.finditer(r'[^\x00-\x7F]', line)