Lines Matching refs:data
30 def parse_method_or_constructor(data: str, start: int = 0) -> Tuple[int, Dict]:
36 end_of_args = parse_declaration_without_postfix(data, start, res)
39 next_semicolon = find_first_of_characters(";", data, start) # <--- for declaration
40 start_of_body = smart_find_first_of_characters("{", data, start) # <--- for definition
46 elif start_of_body != len(data): # <--- definition case
47 start_of_body, end_of_body = find_scope_borders(data, start_of_body)
55 colon_pos = find_first_of_characters(":", data, end_of_args, end_of_function_declaration)
58 if colon_pos == len(data):
60 function_declaration_postfix = data[end_of_args + 1 : end_of_function_declaration].strip(" \n")
61 res["raw_declaration"] = data[start:end_of_function_declaration].strip(" \n")
64 function_declaration_postfix = data[end_of_args + 1 : colon_pos].strip(" \n")
65 res["raw_declaration"] = data[start:colon_pos].strip(" \n")
67 start_of_body, initializers = parse_initializers(data, colon_pos + 1)
68 start_of_body, end_of_body = find_scope_borders(data, start_of_body, "{")
83 def parse_declaration_without_postfix(data: str, start: int, res: Dict[str, Any]) -> int:
85 start_of_args = find_first_of_characters("(", data, start)
87 if start_of_args >= len("operator") and data[start_of_args - len("operator") : start_of_args] == "operator":
88 start_of_args = find_first_of_characters("(", data, start_of_args + 1)
91 start_of_args > find_first_of_characters(";", data, start)
92 and data[start : data.find("\n", start)].find("operator==") == -1
96 end_of_args, res["args"] = parse_arguments(data, start_of_args)
99 start_of_function_name = rfind_first_of_characters(" *&", data, start_of_args - 1) + 1
100 if start_of_function_name > len(data):
102 res["name"] = data[start_of_function_name:start_of_args]
109 res["return_type"] = parse_type(data[start:start_of_function_name].strip(" \n"))
136 def parse_initializers(data: str, start: int = 0) -> Tuple[int, List]: # pylint: disable=C0116
138 current_pos = find_first_not_restricted_character(" \n", data, start)
139 parethese_open = find_first_of_characters("{(", data, current_pos)
141 while data[current_pos] != "{" and parethese_open != -1:
143 parethese_open, parenthese_close = find_scope_borders(data, parethese_open, "")
144 res.append(parse_initializer(data[current_pos : parenthese_close + 1]))
146 current_pos = find_first_not_restricted_character(", \n", data, parenthese_close + 1)
147 parethese_open = find_first_of_characters("{(", data, current_pos)