From 32042d0769fd6021d57bf25b537a73cc82d59986 Mon Sep 17 00:00:00 2001 From: nub31 Date: Mon, 9 Mar 2026 15:44:30 +0100 Subject: [PATCH] Add comma parsing to func call --- compiler/Parser.cs | 3 +++ examples/core/print.nub | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/Parser.cs b/compiler/Parser.cs index c9adcea..d1507ed 100644 --- a/compiler/Parser.cs +++ b/compiler/Parser.cs @@ -467,7 +467,10 @@ public class Parser var parameters = new List(); while (!TryExpectSymbol(Symbol.CloseParen)) + { parameters.Add(ParseExpression()); + TryExpectSymbol(Symbol.Comma); + } expr = new NodeExpressionFuncCall(TokensFrom(startIndex), expr, parameters); } diff --git a/examples/core/print.nub b/examples/core/print.nub index 8409a87..a5716fc 100644 --- a/examples/core/print.nub +++ b/examples/core/print.nub @@ -1,7 +1,7 @@ module core export func print(text: string) { - sys::write(0 text.ptr text.length) + sys::write(0, text.ptr, text.length) } export func println(text: string) {