diff --git a/core/tools/build_mocks b/core/tools/build_mocks index 547632dd3..29d27f5ba 100755 --- a/core/tools/build_mocks +++ b/core/tools/build_mocks @@ -17,6 +17,7 @@ current_indent = 0 current_class = None current_method = None current_package = None +current_method_is_overload = False def split_to_parts(line, mod_desc=None): @@ -24,6 +25,7 @@ def split_to_parts(line, mod_desc=None): global current_class global current_method global current_package + global current_method_is_overload if line.startswith("package: "): current_package = line[9:].strip() @@ -34,6 +36,10 @@ def split_to_parts(line, mod_desc=None): current_class = None return + if line == "@overload\n": + current_method_is_overload = True + return + if line.startswith("class "): current_class = line[6:].split("(")[0].strip(":") current_indent = 0 @@ -51,6 +57,10 @@ def split_to_parts(line, mod_desc=None): yield (current_package, "\n") current_indent = 4 + if current_method_is_overload: + yield (current_package, current_indent * " " + "@overload\n") + current_method_is_overload = False + line = current_indent * " " + line yield (current_package, line)