From a0163315d33cdaf902812782f20d92028440a1f1 Mon Sep 17 00:00:00 2001 From: Linus Lee Date: Thu, 24 Sep 2020 07:47:35 -0400 Subject: [PATCH] Support calling functions with multiple arguments --- static/js/lang.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/lang.js b/static/js/lang.js index d2189ef..5000e81 100644 --- a/static/js/lang.js +++ b/static/js/lang.js @@ -487,8 +487,11 @@ class Parser { } fnCall(fnNode) { this.tokens.expect(T.Of); - // TODO: support multiple arguments const args = [this.expr()]; + while (this.tokens.peek() === T.Comma) { + this.tokens.next(); // comma + args.push(this.expr()); + } return { type: N.FnCall, fn: fnNode,