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 }