mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
JSSpecCompiler: Properly parse function calls with zero arguments
We cannot handle them normally since we need text between parenthesis to be a valid expression. As a workaround, we now push an artificial value to stack to act as an argument (it'll be later removed during function call canonicalization).
This commit is contained in:
parent
14ee25b8ba
commit
33b36476d9
4 changed files with 50 additions and 1 deletions
|
@ -35,6 +35,14 @@ void ErrorNode::dump_tree(StringBuilder& builder)
|
|||
dump_node(builder, "Error \"{}\"", m_error);
|
||||
}
|
||||
|
||||
void WellKnownNode::dump_tree(StringBuilder& builder)
|
||||
{
|
||||
static constexpr StringView type_to_name[] = {
|
||||
"ZeroArgumentFunctionCall"sv,
|
||||
};
|
||||
dump_node(builder, "WellKnownNode {}", type_to_name[m_type]);
|
||||
}
|
||||
|
||||
void ControlFlowFunctionReturn::dump_tree(StringBuilder& builder)
|
||||
{
|
||||
dump_node(builder, "ControlFlowFunctionReturn");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue