Class CollectionLiteralRendering
java.lang.Object
org.ek9lang.compiler.ir.instructions.CollectionLiteralRendering
Shared IR-text rendering for the element setup of collection-literal instructions
(LIST_LITERAL / DICT_LITERAL).
The setup instructions evaluate each element (and any #^ promotion required to widen an
element to the collection's resolved element type) and manage its memory. Rendering them - rather
than hiding them inside the instruction - keeps the IR text faithful and makes promotions
explicit, so @IR directive tests assert them directly and catch regressions. Mirrors the
nested-block style used by CONTROL_FLOW_CHAIN.
-
Method Summary
Modifier and TypeMethodDescription(package private) static voidappendSetupBlock(StringBuilder sb, List<IRInstr> setupInstructions, String scopeId) Append theelement_setupblock for a collection literal, if it has any setup.
-
Method Details
-
appendSetupBlock
Append theelement_setupblock for a collection literal, if it has any setup.- Parameters:
sb- builder receiving the rendered blocksetupInstructions- the element/key/value evaluation + promotion + memory instructionsscopeId- the scope the setup executes within
-