Repository navigation
fix: keep validating after a line without '=' (Resolves #562) - #570
Merged
Merged
Conversation
A line that is not a section, comment or key=value assignment, such as free text with several words, lexes as a KEY followed by BAD_CHARACTER tokens. The parser had no error recovery, so it gave up at that point and the rest of the file became one error element: no later property or section was validated. systemd logs "Missing '=', ignoring line." and carries on. Add recoverWhile rules to the grammar: after a (possibly broken) property, skip to the next token that can start a line (key, section or comment), and if junk appears where a line item should start, skip to the next section header. The bad line is still reported as a missing separator. Found by comparing the plugin with systemd's own parsers over the Debian unit corpus: the kf6/ksyntax-highlighting test units have free text in an [X-...] section, after which several hundred invalid values went unreported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Unit Test Results (grammar engine true)1 777 tests 1 777 ✅ 1m 16s ⏱️ Results for commit 596c3e2. |
Unit Test Results (grammar engine false)1 777 tests 1 777 ✅ 1m 16s ⏱️ Results for commit 596c3e2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A line that is not a section, comment or key=value assignment, such as free text with several words, lexes as a KEY followed by BAD_CHARACTER tokens. The parser had no error recovery, so it gave up at that point and the rest of the file became one error element: no later property or section was validated. systemd logs "Missing '=', ignoring line." and carries on.
Add recoverWhile rules to the grammar: after a (possibly broken) property, skip to the next token that can start a line (key, section or comment), and if junk appears where a line item should start, skip to the next section header. The bad line is still reported as a missing separator.
Found by comparing the plugin with systemd's own parsers over the Debian unit corpus: the kf6/ksyntax-highlighting test units have free text in an [X-...] section, after which several hundred invalid values went unreported.