From bb45124bd951f59283ca087e48c9d069299732db Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Thu, 16 May 2024 15:41:21 +1000 Subject: [PATCH] fix: increase parser lookahead Fixes #1507. I'm really surprised we haven't hit this previously. --- backend/schema/parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/schema/parser.go b/backend/schema/parser.go index e3ceab538e..8dc499819b 100644 --- a/backend/schema/parser.go +++ b/backend/schema/parser.go @@ -47,7 +47,8 @@ var ( participle.Lexer(Lexer), participle.Elide("Whitespace"), participle.Unquote(), - participle.UseLookahead(2), + // Increase lookahead to allow comments to be attached to the next token. + participle.UseLookahead(participle.MaxLookahead), participle.Map(func(token lexer.Token) (lexer.Token, error) { token.Value = strings.TrimSpace(strings.TrimPrefix(token.Value, "//")) return token, nil