From 219d4b4f7eb9909df62f1d9e338dca3f54d75c8d Mon Sep 17 00:00:00 2001 From: Sofia Date: Sun, 15 Mar 2026 15:19:01 +0200 Subject: [PATCH] Fix function call expressions --- examples/test.lua | 3 +-- src/ast.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/test.lua b/examples/test.lua index 7fe7924..5f4ad17 100644 --- a/examples/test.lua +++ b/examples/test.lua @@ -4,5 +4,4 @@ function add(x) end end -local d = add(5) -global c = print(d(7)) \ No newline at end of file +global c = print(add(5)(7)) \ No newline at end of file diff --git a/src/ast.rs b/src/ast.rs index 03f38b5..bf6b742 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -344,7 +344,7 @@ impl Parse for PrimaryExpression { Expression::ValueRef(stream.parse()?) }; - if let Some(Token::Symbol('(')) = stream.peek() { + while let Some(Token::Symbol('(')) = stream.peek() { stream.next(); let expression_list = stream.parse::>()?; stream.expect(Token::Symbol(')'))?;