From 7f66502fc466d27506eedd003e5ecf417f205cbc Mon Sep 17 00:00:00 2001 From: karitham Date: Thu, 3 Sep 2026 15:10:36 +0200 Subject: [PATCH] syntax: recover later functions after a bad one --- syntax/parser.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/syntax/parser.go b/syntax/parser.go index 09d8e00..2aa19c9 100644 --- a/syntax/parser.go +++ b/syntax/parser.go @@ -479,7 +479,14 @@ func (p *parser) parseService() Node { for !p.at(TokenRBrace) && !p.at(TokenEOF) { f := p.parseFunction() if f == nil { - p.synchronizeTo(TokenRBrace) + // Skip the bad function's parameter list, if any, so + // later functions still parse: stop at its closing + // paren (or the service's closing brace) and step past + // the paren. + p.synchronizeTo(TokenRParen, TokenRBrace) + if p.at(TokenRParen) { + p.advance() + } continue } -- 2.51.2