1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

JSSpecCompiler: Make function arguments parsing much simpler

In a nutshell, when we understand that the expression is a function
call (this happens at '(' after an expression), stop parsing expression
and start parsing function arguments. This makes
`FunctionCallCanonicalizationPass` and the workaround for zero argument
function calls obsolete.
This commit is contained in:
Dan Klishch 2024-01-21 13:51:05 -05:00 committed by Andrew Kaster
parent 990e30f458
commit d14bb7e91e
10 changed files with 37 additions and 114 deletions

View file

@ -139,7 +139,6 @@ public:
This,
True,
Undefined,
ZeroArgumentFunctionCall,
// Update WellKnownNode::dump_tree after adding an entry here
};
@ -156,7 +155,6 @@ private:
};
inline Tree const error_tree = make_ref_counted<ErrorNode>();
inline Tree const zero_argument_function_call = make_ref_counted<WellKnownNode>(WellKnownNode::ZeroArgumentFunctionCall);
class ControlFlowFunctionReturn : public ControlFlowOperator {
public:
@ -256,7 +254,6 @@ protected:
F(CompareNotEqual) \
F(Declaration) \
F(Division) \
F(FunctionCall) \
F(MemberAccess) \
F(Minus) \
F(Multiplication) \