2026.04.30.1¶
~literalizer.literalize_callaccepts a newconsumable_refsparameter listing the ref identifiers the call may move from. In C++, only refs in this set – and only when they appear in exactly one call argument across the rendered calls – are wrapped instd::move(...); all other refs emit as the bare identifier so the variable remains valid for any subsequent use (whether in a later per-element call within the sameliteralize_callblock, or elsewhere in the surrounding source). Mojo’s^transfer operator is treated the same way. This is a breaking change: previously C++ unconditionally wrapped every call-argument ref instd::move(...), which produced use-after-move when the same variable was referenced by more than one per-element call. Passconsumable_refs={"my_var"}to restore the previous behavior formy_var.~literalizer.literalizeand~literalizer.literalize_callnow accept aref_keyparameter (str, default"$ref"). The marker key used to identify variable-reference mappings in the input data is now user-configurable. A single-key dict whose key equals ref_key and whose value is a string is treated as a ref marker. Passref_caseonly when the identifier name should be converted before rendering.Every built-in language class now exposes a
VersionFormatsenum and a configurablelanguage_versionconstructor parameter that selects which version of the target language the generated code is written for. For example,Ada().language_versiondefaults toAda.version_formats.ADA_2022, whose.valueis"Ada 2022". Each language currently defines a single version; additional versions may be added in future releases. Bothversion_formatsandlanguage_versionare part of the~literalizer.Languageprotocol, so custom language implementations must also define them.