MCPcopy Index your code
hub / github.com/python/cpython / emit_tokens

Method emit_tokens

Tools/cases_generator/generators_common.py:730–747  ·  view source on GitHub ↗
(
        self,
        code: CodeSection,
        storage: Storage,
        inst: Instruction | None,
        emit_braces: bool = True
    )

Source from the content-addressed store, hash-verified

728
729
730 def emit_tokens(
731 self,
732 code: CodeSection,
733 storage: Storage,
734 inst: Instruction | None,
735 emit_braces: bool = True
736 ) -> tuple[bool, Storage]:
737 self.out.start_line()
738 reachable, tkn, storage = self.emit_BlockStmt(code.body, code, storage, inst, emit_braces)
739 assert tkn is not None
740 try:
741 if reachable:
742 storage.push_outputs()
743 if emit_braces:
744 self.out.emit(tkn)
745 except StackError as ex:
746 raise analysis_error(ex.args[0], tkn) from None
747 return reachable, storage
748
749 def emit(self, txt: str | Token) -> None:
750 self.out.emit(txt)

Callers 5

write_uopFunction · 0.80
write_uopFunction · 0.80
write_uopFunction · 0.80
generate_tier1_labelsFunction · 0.80

Calls 5

emit_BlockStmtMethod · 0.95
analysis_errorFunction · 0.90
start_lineMethod · 0.80
push_outputsMethod · 0.80
emitMethod · 0.45

Tested by

no test coverage detected