1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:35:07 +00:00

JSSpecCompiler: Store arguments in declaration instead of definition

And create a struct encapsulating argument name in the preparation for
argument types and optional arguments.
This commit is contained in:
Dan Klishch 2024-01-15 23:02:35 -05:00 committed by Andrew Kaster
parent 0806ccaeec
commit 483e195e48
8 changed files with 57 additions and 40 deletions

View file

@ -24,9 +24,9 @@ NonnullRefPtr<FunctionDefinition> CppASTConverter::convert()
}
auto tree = make_ref_counted<TreeList>(move(toplevel_statements));
Vector<StringView> arguments;
Vector<FunctionArgument> arguments;
for (auto const& parameter : m_function->parameters())
arguments.append(parameter->full_name());
arguments.append({ .name = parameter->full_name() });
return make_ref_counted<FunctionDefinition>(name, tree, move(arguments));
}