Conversation
…ts spellings
Review follow-up. Three of the new validators wrote parse_boolean()'s twelve spellings out
by hand, two of them folded into a larger choice set so the boolean was no longer
distinguishable from the enum it sat next to. To systemd these are separate branches, and
keeping them separate in the grammar means a later pass — a formatter normalising yes/Yes,
completion offering only the sensible half — can tell which is which from the grammar
rather than by re-sniffing the text.
ConditionVirtualization= AlternativeCombinator(names, BOOLEAN)
DuplicateAddressDetection= AlternativeCombinator(families, deprecatedBoolean(...))
PreferredSource= BOOLEAN_FALSE, a named home for the false-only spellings
config_parse_preferred_src accepts
Ordering matters in both alternations and is now commented at each site: BOOLEAN matches a
*prefix*, so on `none` — a real virtualization_table entry, and a DAD family name — it
would take the leading `no` and strand `ne`, which the classic first-full-match engine
cannot back out of.
deprecatedBoolean() returns a FRESH terminal each call. FlexibleLiteralChoiceTerminal
.deprecating() mutates in place, so reusing the shared BOOLEAN for DuplicateAddressDetection=
would have attached its "For historical reasons" note to every boolean-valued setting in the
plugin. DeprecationsTest now pins that isolation.
New tests for three things raised in review that turned out to already hold, so they stay
holding: `ConditionArchitecture=ppc64-le` and `=arm64-be` are not truncated to their shorter
prefixes, `ConditionControlGroupController=cpuacct io` parses as two controllers rather than
stopping at `cpu`, and ConditionFirstBoot=/ConditionACPower= still take every boolean
spelling with the [|] [!] markers. FlexibleLiteralChoiceTerminal sorts its choices
longest-first in its init block, so declaration order in these files is cosmetic — the tests
say so explicitly to stop someone "fixing" it later.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
issue-509
branch
from
August 29, 2026 22:37
51dcd02 to
56ef309
Compare
Unit Test Results (grammar engine false)1 263 tests 1 263 ✅ 52s ⏱️ Results for commit 56ef309. |
Unit Test Results (grammar engine true)1 263 tests 1 263 ✅ 1m 1s ⏱️ Results for commit 56ef309. |
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.
…ts spellings
Review follow-up. Three of the new validators wrote parse_boolean()'s twelve spellings out by hand, two of them folded into a larger choice set so the boolean was no longer distinguishable from the enum it sat next to. To systemd these are separate branches, and keeping them separate in the grammar means a later pass — a formatter normalising yes/Yes, completion offering only the sensible half — can tell which is which from the grammar rather than by re-sniffing the text.
ConditionVirtualization= AlternativeCombinator(names, BOOLEAN)
DuplicateAddressDetection= AlternativeCombinator(families, deprecatedBoolean(...))
PreferredSource= BOOLEAN_FALSE, a named home for the false-only spellings
config_parse_preferred_src accepts
Ordering matters in both alternations and is now commented at each site: BOOLEAN matches a prefix, so on
none— a real virtualization_table entry, and a DAD family name — it would take the leadingnoand strandne, which the classic first-full-match engine cannot back out of.deprecatedBoolean() returns a FRESH terminal each call. FlexibleLiteralChoiceTerminal .deprecating() mutates in place, so reusing the shared BOOLEAN for DuplicateAddressDetection= would have attached its "For historical reasons" note to every boolean-valued setting in the plugin. DeprecationsTest now pins that isolation.
New tests for three things raised in review that turned out to already hold, so they stay holding:
ConditionArchitecture=ppc64-leand=arm64-beare not truncated to their shorter prefixes,ConditionControlGroupController=cpuacct ioparses as two controllers rather than stopping atcpu, and ConditionFirstBoot=/ConditionACPower= still take every boolean spelling with the [|] [!] markers. FlexibleLiteralChoiceTerminal sorts its choices longest-first in its init block, so declaration order in these files is cosmetic — the tests say so explicitly to stop someone "fixing" it later.