mirror of
https://github.com/lightbend/config.git
synced 2025-03-23 07:40:25 +08:00
Fix a line numbering off-by-one in parser
When we see a newline token, its number is the line it was on (i.e. the line just ended) not the line we are now on. This was correct in one place in Parser.java but not in the other place.
This commit is contained in:
parent
907048fe2b
commit
2a7c403aa6
@ -110,7 +110,8 @@ final class Parser {
|
||||
Token t = nextToken();
|
||||
while (true) {
|
||||
if (Tokens.isNewline(t)) {
|
||||
lineNumber = Tokens.getLineNumber(t);
|
||||
// newline number is the line just ended, so add one
|
||||
lineNumber = Tokens.getLineNumber(t) + 1;
|
||||
sawSeparatorOrNewline = true;
|
||||
// we want to continue to also eat
|
||||
// a comma if there is one.
|
||||
|
Loading…
Reference in New Issue
Block a user