Skip to content

Commit

Permalink
Include the line number when reporting an extra '}' or '>', rather th…
Browse files Browse the repository at this point in the history
…an just the character index.

PiperOrigin-RevId: 688619518
  • Loading branch information
txtpbfmt-copybara-robot committed Oct 23, 2024
1 parent 8e6b51f commit ee4f8a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func sameLineBrackets(in []byte, allowTripleQuotedStrings bool) (map[int]bool, e
continue
}
if len(open) == 0 {
return nil, fmt.Errorf("too many '}' or '>' at index %d", i)
return nil, fmt.Errorf("too many '}' or '>' at line %d, index %d", line, i)
}
last := len(open) - 1
br := open[last]
Expand Down

0 comments on commit ee4f8a5

Please sign in to comment.