From e73b7dd454e8a07527a2ecdc0a824f989ef39d6a Mon Sep 17 00:00:00 2001 From: Nobilta <59631965+Nobilta@users.noreply.github.com> Date: Mon, 14 Oct 2024 03:18:09 +0800 Subject: [PATCH] fix unexpected token BlockEnd (}) (#49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix unexpected token BlockEnd (}) * fix detecting end of the block --------- Co-authored-by: Tufan Barış Yıldırım --- parser/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser/parser.go b/parser/parser.go index b53e215..db911b1 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -260,6 +260,9 @@ func (p *Parser) parseStatement(isSkipValidDirective bool) (config.IDirective, e //parse parameters until the end. for p.nextToken(); p.currentToken.IsParameterEligible(); p.nextToken() { d.Parameters = append(d.Parameters, p.currentToken.Literal) + if p.currentToken.Is(token.BlockEnd) { + return d, nil + } } //if we find a semicolon it is a directive, we will check directive converters