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(')'))?;