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

Function emit_to

Tools/cases_generator/generators_common.py:78–88  ·  view source on GitHub ↗
(out: CWriter, tkn_iter: TokenIterator, end: str)

Source from the content-addressed store, hash-verified

76
77
78def emit_to(out: CWriter, tkn_iter: TokenIterator, end: str) -> Token:
79 parens = 0
80 for tkn in tkn_iter:
81 if tkn.kind == end and parens == 0:
82 return tkn
83 if tkn.kind == "LPAREN":
84 parens += 1
85 if tkn.kind == "RPAREN":
86 parens -= 1
87 out.emit(tkn)
88 raise analysis_error(f"Expecting {end}. Reached end of file", tkn)
89
90
91ReplacementFunctionType = Callable[

Callers 11

record_valueMethod · 0.90
exit_ifMethod · 0.90
tier2_to_tier2Method · 0.90
exit_if_afterMethod · 0.90
unreachableMethod · 0.85
deopt_ifMethod · 0.85
error_ifMethod · 0.85
tier1_to_tier2Method · 0.85
stackref_stealMethod · 0.85
emit_SimpleStmtMethod · 0.85

Calls 2

analysis_errorFunction · 0.90
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…