From 13fac099705259793bfe97bddf912d3951049012 Mon Sep 17 00:00:00 2001 From: Woccz <44993506+Woccz@users.noreply.github.com> Date: Thu, 28 Apr 2022 00:35:33 +1200 Subject: [PATCH] Parser permit inline comments (untested) --- pkg/parser/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 64f1700..f956139 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -172,7 +172,7 @@ func (p *Parser) ErrorString(message string, code string) { func (p *Parser) Expect(tokenType string, tokenValue string) ast.Position { if !p.IsCurrent(tokenType, tokenValue) { var msg string - if tokenType == ast.TypeNewline { + if tokenType == ast.TypeNewline || tokenType == ast.TypeComment { msg = "Expected newline" } else { msg = fmt.Sprintf("Expected token '%s'(%s)", tokenValue, tokenType)