From 64146b46da45ce69ab380add00459f7b60fe9196 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 6 Jan 2026 15:51:30 +0200 Subject: allow omitting ';' in trivial calls --- examples/vec.fwd | 2 +- src/parser.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vec.fwd b/examples/vec.fwd index 6c854d5..f7838f1 100644 --- a/examples/vec.fwd +++ b/examples/vec.fwd @@ -67,7 +67,7 @@ append_vec(vec v, i64 e, (vec) ok) at_vec(vec v, u64 i, (vec, &i64) ok) { v => [n => n, s => s, buf => buf]; - if i >= n {fwdpanic("bounds error");} + guard(i < n) => {fwdpanic("bounds error")} => ; fwdptradd(buf, (i * sizeof(i64)) as i64) => *i64 buf; nil buf {fwdpanic("should never happen");} => &i64 bufr; ok([n => n, s => s, buf => buf] vec, bufr); diff --git a/src/parser.y b/src/parser.y index 9607e71..5f46895 100644 --- a/src/parser.y +++ b/src/parser.y @@ -395,7 +395,7 @@ closures } call - : expr "(" opt_exprs ")" ";" { + : expr "(" opt_exprs ")" { $$ = gen_call($1, $[opt_exprs], src_loc(@$)); } | expr "(" opt_exprs ")" "=>" opt_vars ";" { -- cgit v1.2.3