feat(scraper): only use property_summary_type
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details

This commit is contained in:
Aire-One 2022-10-31 15:03:39 +01:00
parent 0c94593b85
commit c21eda0a3f
1 changed files with 11 additions and 12 deletions

View File

@ -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<string>
-- 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