From f44a02868392e3db7e927e6efceea9180cf11642 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Mon, 31 Jul 2023 19:20:32 +0200 Subject: [PATCH] fix(scraper): rename constructor methods to `new` --- src/awesomewm.d.tl/scraper/module_doc.tl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/awesomewm.d.tl/scraper/module_doc.tl b/src/awesomewm.d.tl/scraper/module_doc.tl index ba5663c..0eb0f66 100644 --- a/src/awesomewm.d.tl/scraper/module_doc.tl +++ b/src/awesomewm.d.tl/scraper/module_doc.tl @@ -212,7 +212,13 @@ end -- - Strings that should be added to the record Signals local section_scrapers : { Section : function(html: string, record_name: string, module_name: string): { Node }, { Node }, { string } } = { ["Constructors"] = function(html: string): { Node }, { Node }, { string } - return extract_section_functions(html), {}, {} + local constructors = extract_section_functions(html) + for _, constructor in ipairs(constructors) do + if constructor.token == "function" then + constructor.name = "new" + end + end + return constructors, {}, {} end, ["Static module functions"] = function(html: string, _: string, module_name: string): { Node }, { Node }, { string } local static_functions, other_functions = extract_section_functions(html, module_name)