Engine callbacks borrowed for the translator's lifetime.
More...
#include <doc_translator.h>
Engine callbacks borrowed for the translator's lifetime.
◆ alloc_id
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::alloc_id) (DocTranslatorObj *translator, ffi::AnyView hint) noexcept |
|
noexcept |
Reserve an identifier without mapping a variable.
- Parameters
-
| translator | The borrowed translation context. |
| hint | The borrowed string name hint. |
- Returns
- An owning Expected<IdDoc> encoded as TVMFFIAny, including errors.
◆ begin_var_scope
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::begin_var_scope) (DocTranslatorObj *translator) noexcept |
|
noexcept |
Begin a lexical variable scope.
- Parameters
-
| translator | The borrowed translation context. |
- Returns
- Expected<void> encoded as TVMFFIAny, including errors.
◆ end_var_scope
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::end_var_scope) (DocTranslatorObj *translator) noexcept |
|
noexcept |
End the current lexical variable scope.
- Parameters
-
| translator | The borrowed translation context. |
- Returns
- Expected<void> encoded as TVMFFIAny, including errors.
◆ get_implicit_defs
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::get_implicit_defs) (DocTranslatorObj *translator) noexcept |
|
noexcept |
Get the current variable scope's pending definitions.
- Parameters
-
| translator | The borrowed translation context. |
- Returns
- An owning Expected<Dict<Var, IdDoc>> encoded as TVMFFIAny, including errors.
◆ translate
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::translate) (DocTranslatorObj *translator, ffi::AnyView value, const ffi::Object *destination) noexcept |
|
noexcept |
Translate a value with an optional pre-mapped destination.
- Parameters
-
| translator | The borrowed translation context. |
| value | The borrowed input value. |
| destination | A borrowed Var, or nullptr when no binding is requested. |
- Returns
- An owning Expected<Optional<ExprDoc>> encoded as TVMFFIAny. None means emission completed the request; errors use Expected's error encoding.
◆ var_get_or_alloc_id
| TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::var_get_or_alloc_id) (DocTranslatorObj *translator, ffi::AnyView var, bool explicit_def) noexcept |
|
noexcept |
Find or allocate a variable's identifier.
- Parameters
-
| translator | The borrowed translation context. |
| var | The borrowed variable. |
| explicit_def | Whether to remove the binding from pending definitions. |
- Returns
- An owning Expected<IdDoc> encoded as TVMFFIAny, including errors.
The documentation for this struct was generated from the following file: