mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +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:
parent
990e30f458
commit
d14bb7e91e
10 changed files with 37 additions and 114 deletions
|
@ -26,34 +26,6 @@ TreeList
|
|||
ReturnNode
|
||||
UnresolvedReference b
|
||||
|
||||
===== AST after function-call-canonicalization =====
|
||||
f(cond1, cond2):
|
||||
TreeList
|
||||
IfBranch
|
||||
UnresolvedReference cond1
|
||||
TreeList
|
||||
BinaryOperation Declaration
|
||||
UnresolvedReference a
|
||||
MathematicalConstant 1
|
||||
IfBranch
|
||||
UnresolvedReference cond2
|
||||
TreeList
|
||||
BinaryOperation Declaration
|
||||
UnresolvedReference b
|
||||
UnresolvedReference a
|
||||
ElseIfBranch Else
|
||||
TreeList
|
||||
BinaryOperation Declaration
|
||||
UnresolvedReference b
|
||||
MathematicalConstant 3
|
||||
ElseIfBranch Else
|
||||
TreeList
|
||||
BinaryOperation Declaration
|
||||
UnresolvedReference b
|
||||
MathematicalConstant 4
|
||||
ReturnNode
|
||||
UnresolvedReference b
|
||||
|
||||
===== AST after if-branch-merging =====
|
||||
f(cond1, cond2):
|
||||
TreeList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue