MCPcopy Index your code
hub / github.com/Nuitka/Nuitka / getNonModuleVariableReferenceCode

Function getNonModuleVariableReferenceCode

nuitka/code_generation/VariableCodes.py:156–189  ·  view source on GitHub ↗
(
    to_name, variable, variable_trace, needs_check, conversion_check, emit, context
)

Source from the content-addressed store, hash-verified

154
155
156def getNonModuleVariableReferenceCode(
157 to_name, variable, variable_trace, needs_check, conversion_check, emit, context
158):
159 if variable.isModuleVariable():
160 assert False
161 else:
162 variable_declaration = getLocalVariableDeclaration(
163 context, variable, variable_trace
164 )
165
166 value_name = variable_declaration.getCType().emitValueAccessCode(
167 value_name=variable_declaration, emit=emit, context=context
168 )
169
170 if needs_check:
171 condition = value_name.getCType().getInitTestConditionCode(
172 value_name, inverted=True
173 )
174
175 getLocalVariableReferenceErrorCode(
176 variable=variable, condition=condition, emit=emit, context=context
177 )
178 else:
179 value_name.getCType().emitValueAssertionCode(
180 value_name=value_name, emit=emit
181 )
182
183 to_name.getCType().emitAssignConversionCode(
184 to_name=to_name,
185 value_name=value_name,
186 needs_check=conversion_check,
187 emit=emit,
188 context=context,
189 )
190
191
192def generateVariableReferenceCode(to_name, expression, emit, context):

Callers 2

Calls 8

isModuleVariableMethod · 0.45
emitValueAccessCodeMethod · 0.45
getCTypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…