From c21eda0a3fa579d5a62429344980400a561b230d Mon Sep 17 00:00:00 2001 From: Aire-One Date: Mon, 31 Oct 2022 15:03:39 +0100 Subject: [PATCH] feat(scraper): only use property_summary_type --- src/awesomewm.d.tl/scraper/module_doc.tl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/awesomewm.d.tl/scraper/module_doc.tl b/src/awesomewm.d.tl/scraper/module_doc.tl index aa91396..738ce2d 100644 --- a/src/awesomewm.d.tl/scraper/module_doc.tl +++ b/src/awesomewm.d.tl/scraper/module_doc.tl @@ -55,18 +55,18 @@ local function extract_function_return_types(function_return_types_node: scan.HT return scraper_utils.scrape(html, selector, extract_node_text) end -local function extract_property_types(property_summary_type: scan.HTMLNode, property_constraint_node: scan.HTMLNode): { string } - local constraint_types = scraper_utils.scrape( - property_constraint_node:outer_html(), - "tr.see_also_sublist", - extract_node_text - ) +local function extract_property_types(property_summary_type: scan.HTMLNode, property_constraint_node: scan.HTMLNode): List + -- local constraint_types = scraper_utils.scrape( + -- property_constraint_node:outer_html(), + -- "tr.see_also_sublist", + -- extract_node_text + -- ) - if #constraint_types == 0 then - return { extract_node_text(property_summary_type) } - end + -- if #constraint_types == 0 then + return parse_parameter_types(extract_node_text(property_summary_type)) + -- end - return constraint_types + -- return constraint_types end local function extract_section_functions(dl: string): { Function_Info.Function_Info } @@ -111,10 +111,9 @@ local function extract_section_variables(dl: string): { Variable_Info.Variable_I local variable_info = Variable_Info() variable_info.name = extract_item_name(nodes[query_selectors.variable_name]) - variable_info.types = List(extract_property_types( + variable_info.types = extract_property_types( nodes[query_selectors.variable_summary_type], nodes[query_selectors.variable_property_constraint]) - ) return variable_info end