fix: Blank line after a backslash continuation swallows the next key #21

Merged
onlyati merged 1 commit from fix/multiline-continuation-blank-line into main 2026-09-14 21:11:11 +00:00
Owner

A cont_sign ('\') is meant to fold only the single line right after it, but the lexer inferred "still folding" from whether the last emitted token was a cont_sign. Blank lines emit no token, so that check stayed true across any number of blank lines and even leaked into the next, unrelated keyword's parse (readKeyValuePair is re-entered once per keyword), silently merging it into the previous value.

Track fold state explicitly on the Lexer instead of inferring it from the token stream, so a continuation ends after exactly one folded line.

A cont_sign ('\\') is meant to fold only the single line right after it, but the lexer inferred "still folding" from whether the last emitted token was a cont_sign. Blank lines emit no token, so that check stayed true across any number of blank lines and even leaked into the next, unrelated keyword's parse (readKeyValuePair is re-entered once per keyword), silently merging it into the previous value. Track fold state explicitly on the Lexer instead of inferring it from the token stream, so a continuation ends after exactly one folded line.
fix: Blank line after a backslash continuation swallows the next key
All checks were successful
ci/woodpecker/pr/pr_check Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
47edb82dbf
A cont_sign ('\') is meant to fold only the single line right after it,
but the lexer inferred "still folding" from whether the last emitted
token was a cont_sign. Blank lines emit no token, so that check stayed
true across any number of blank lines and even leaked into the next,
unrelated keyword's parse (readKeyValuePair is re-entered once per
keyword), silently merging it into the previous value.

Track fold state explicitly on the Lexer instead of inferring it from
the token stream, so a continuation ends after exactly one folded line.
onlyati deleted branch fix/multiline-continuation-blank-line 2026-09-14 21:11:11 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandora/systemd-file.gopack!21
No description provided.