|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The growing LuaCATS document shared by every writer handle. More...
#include <welder/rods/lua/luacats/document.hpp>
Public Member Functions | |
| void | declare_table (std::string_view prefix, const char *doc=nullptr) |
| Record (once) a module table to declare, updating its doc if given. | |
| void | record_type_name (std::string_view raw, std::string_view styled) |
| Register a welded type's declared name so references to it are reconciled at render. | |
| std::string | render () const |
| The finished stub text: the ---@meta header, the module tables shallowest first, then the accumulated declarations. | |
Public Attributes | |
| std::vector< table_decl > | tables {} |
| std::string | body {} |
| std::vector< std::pair< std::string, std::string > > | type_renames {} |
| Raw C++ dotted name → styled/weld_as bound name, for reconciling type references* with their declarations at render (see apply_type_renames). | |
The growing LuaCATS document shared by every writer handle.
Class/enum/function text lands in body; module tables are collected in tables and rendered (shallowest first) ahead of it, since a geometry.Point class or a geometry.foo function needs the geometry table to exist.
Definition at line 270 of file document.hpp.
|
inline |
Record (once) a module table to declare, updating its doc if given.
| prefix | the dotted table path to declare. |
| doc | the table's namespace doc, or nullptr. |
Definition at line 281 of file document.hpp.
References welder::doc(), and tables.
Referenced by welder::rods::luacats::rod::add_submodule(), and welder::rods::luacats::rod::set_module_doc().
|
inline |
Register a welded type's declared name so references to it are reconciled at render.
A no-op when the name is unchanged (the welder::naming::none default, or a type the style/weld_as leaves alone), so the default stub is emitted byte-for-byte as before.
| raw | the type's raw C++ dotted name (qualified_name). |
| styled | the type's declared LuaCATS name (its class_writer::qualified). |
Definition at line 297 of file document.hpp.
References type_renames.
Referenced by welder::rods::luacats::rod::make_class(), welder::rods::luacats::rod::make_enum(), welder::rods::luacats::rod::make_nested_class(), and welder::rods::luacats::rod::make_nested_enum().
|
inline |
The finished stub text: the ---@meta header, the module tables shallowest first, then the accumulated declarations.
Definition at line 309 of file document.hpp.
References welder::rods::luacats::apply_type_renames(), body, welder::rods::luacats::emit_doc_comment(), tables, and type_renames.
| std::string welder::rods::luacats::document::body {} |
Definition at line 272 of file document.hpp.
Referenced by welder::rods::luacats::rod::add_function(), welder::rods::luacats::rod::add_variable(), and render().
| std::vector<table_decl> welder::rods::luacats::document::tables {} |
Definition at line 271 of file document.hpp.
Referenced by declare_table(), and render().
| std::vector<std::pair<std::string, std::string> > welder::rods::luacats::document::type_renames {} |
Raw C++ dotted name → styled/weld_as bound name, for reconciling type references* with their declarations at render (see apply_type_renames).
Populated by record_type_name as each type is made.
Definition at line 276 of file document.hpp.
Referenced by record_type_name(), and render().