MCPcopy Create free account
hub / github.com/sphinx-doc/sphinx / finalize_block

Method finalize_block

sphinx/pycode/parser.py:578–588  ·  view source on GitHub ↗

Finalize definition block.

(self)

Source from the content-addressed store, hash-verified

576 self.context.pop()
577
578 def finalize_block(self) -> None:
579 """Finalize definition block."""
580 definition = self.indents.pop()
581 if definition[0] != 'other':
582 typ, funcname, start_pos = definition
583 end_pos = self.current.end[0] - 1 # type: ignore[union-attr]
584 while emptyline_re.match(self.get_line(end_pos)):
585 end_pos -= 1
586
587 self.add_definition(funcname, (typ, start_pos, end_pos)) # type: ignore[arg-type]
588 self.context.pop()
589
590
591class Parser:

Callers 1

parseMethod · 0.95

Calls 4

add_definitionMethod · 0.95
popMethod · 0.80
matchMethod · 0.45
get_lineMethod · 0.45

Tested by

no test coverage detected