Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
erlend-aasland and AlexWaygood authored Aug 1, 2023
commit 83af46d7c2eabcb23cb31a315c7dbb043a312461
7 changes: 5 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4619,7 +4619,10 @@ def parse(self, block: Block) -> None:

def in_docstring(self) -> bool:
"""Return true if we are processing a docstring."""
return "docstring" in self.state.__name__
return self.state in {
self.state_parameter_docstring,
self.state_function_docstring,
}

def valid_line(self, line: str) -> bool:
# ignore comment-only lines
Expand Down Expand Up @@ -5292,7 +5295,7 @@ def state_parameter_docstring(self, line: str) -> None:
return self.next(self.state_function_docstring, line)

assert self.function and self.function.parameters
last_param = list(self.function.parameters.values())[-1]
last_param = next(reversed(self.function.parameters.values()))
self.docstring_append(last_param, line)

# the final stanza of the DSL is the docstring.
Expand Down