Skip to content

Commit

Permalink
fix: increase parser lookahead (#1510)
Browse files Browse the repository at this point in the history
Fixes #1507. I'm really surprised we haven't hit this previously.
  • Loading branch information
alecthomas authored May 16, 2024
1 parent a44e99b commit 57b5402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/schema/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57b5402

Please sign in to comment.