From 4a10957c5737fb908ad731b57139e545d3f2124c Mon Sep 17 00:00:00 2001 From: Aire-One Date: Thu, 3 Nov 2022 19:47:22 +0100 Subject: [PATCH 1/2] feat(generator): render constructor as a function --- src/awesomewm.d.tl/generator/teal_type_definitions.tl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/awesomewm.d.tl/generator/teal_type_definitions.tl b/src/awesomewm.d.tl/generator/teal_type_definitions.tl index 6f3d899..d9f58c5 100644 --- a/src/awesomewm.d.tl/generator/teal_type_definitions.tl +++ b/src/awesomewm.d.tl/generator/teal_type_definitions.tl @@ -21,7 +21,12 @@ $(snippets.indent(snippets.render_record_functions(module.methods))) # if #module.properties ~= 0 then -- Object properties $(snippets.indent(snippets.render_record_properties(module.properties))) + # end -- /properties +# if #module.constructors ~= 0 then + -- Constructors +$(snippets.indent(snippets.render_record_functions(module.constructors))) +# end -- /constructors end return $(module.record_name) From 755d0d6b118e059ac836c1fbf606b108d68bd5a8 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 9 Dec 2022 21:36:38 +0100 Subject: [PATCH 2/2] fix(entity): remove `constructor_param_record` --- src/awesomewm.d.tl/entity/Module_Doc.tl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/awesomewm.d.tl/entity/Module_Doc.tl b/src/awesomewm.d.tl/entity/Module_Doc.tl index 484bd75..2d4495f 100644 --- a/src/awesomewm.d.tl/entity/Module_Doc.tl +++ b/src/awesomewm.d.tl/entity/Module_Doc.tl @@ -9,8 +9,7 @@ local record Module_Doc record_name: string - constructors: List -- Translates to a list of methods - constructor_param_record: List -- Constructor with the __call metamethod and named parameters pattern + constructors: List methods: List properties: List @@ -22,7 +21,6 @@ local __Module_Doc: metatable = { __call = function(_: Module_Doc): Module_Doc return { constructors = List(), - constructor_param_record = List(), methods = List(), properties = List(), static_functions = List(),