MCPcopy Create free account
hub / github.com/SplootCode/splootcode / generateElseStatement

Function generateElseStatement

python/executor.py:386–408  ·  view source on GitHub ↗
(else_node, traced)

Source from the content-addressed store, hash-verified

384
385
386def generateElseStatement(else_node, traced):
387 statements = getStatementsFromBlock(else_node["childSets"]["block"], traced)
388 if not traced:
389 return statements
390
391 key = ast.Name(id=SPLOOT_KEY, ctx=ast.Load())
392 func = ast.Attribute(value=key, attr="startFrame", ctx=ast.Load())
393 else_start_frame = ast.Call(
394 func,
395 args=[
396 ast.Constant("PYTHON_ELSE_STATEMENT"),
397 ast.Constant("block"),
398 ],
399 keywords=[],
400 )
401 statements.insert(0, ast.Expr(else_start_frame, lineno=1, col_offset=0))
402
403 key = ast.Name(id=SPLOOT_KEY, ctx=ast.Load())
404 func = ast.Attribute(value=key, attr="endFrame", ctx=ast.Load())
405 call_end_frame = ast.Call(func, args=[], keywords=[])
406 statements.append(ast.Expr(call_end_frame, lineno=1, col_offset=0))
407
408 return statements
409
410def generateFromImportStatement(import_node, traced, lineno):
411 moduleName = import_node['childSets']['module'][0]['properties']['identifier']

Callers 1

generateElifNestedChainFunction · 0.70

Calls 1

getStatementsFromBlockFunction · 0.70

Tested by

no test coverage detected