Support calling functions with multiple arguments
This commit is contained in:
parent
d7c1ae4f76
commit
a0163315d3
@ -487,8 +487,11 @@ class Parser {
|
|||||||
}
|
}
|
||||||
fnCall(fnNode) {
|
fnCall(fnNode) {
|
||||||
this.tokens.expect(T.Of);
|
this.tokens.expect(T.Of);
|
||||||
// TODO: support multiple arguments
|
|
||||||
const args = [this.expr()];
|
const args = [this.expr()];
|
||||||
|
while (this.tokens.peek() === T.Comma) {
|
||||||
|
this.tokens.next(); // comma
|
||||||
|
args.push(this.expr());
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
type: N.FnCall,
|
type: N.FnCall,
|
||||||
fn: fnNode,
|
fn: fnNode,
|
||||||
|
Loading…
Reference in New Issue
Block a user