From 57b54029c4d550adc5dbecdcc39441436a8c9480 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Thu, 16 May 2024 15:45:05 +1000 Subject: [PATCH] fix: increase parser lookahead (#1510) 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 67155de8ea..d48bc3837e 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