Repository navigation
feat: add shared grammar terminals for systemd integer and route-table parsing - #566
Merged
Merged
Conversation
sjrx-claude-sandbox
force-pushed
the
feat/shared-terminals
branch
from
October 24, 2026 18:22
5ee5335 to
7e52763
Compare
…e parsing (Resolves #563) Add SafeAtoTerminal, an exact model of systemd's safe_ato* family at 0f0682b773: signed/unsigned, base 0/8/10/16, the SAFE_ATO_REFUSE_* flags, BigInteger bounds up to the full 64-bit range, mangle_base's 0b/0o prefixes (with the sign and whitespace strtoul accepts after them), the disabled C23 0b support, and strtoul's modulo-2^64 wrap-around. Malformed input is a syntax error located where strtoul stops; out-of-range values are a semantic error on the number token. It works with both grammar engines, and valueOf() returns the stored value for predicates. Add ROUTE_TABLE_FROM_STRING for manager_get_route_table_from_string(): the predefined names, a non-zero safe_atou32, or any value that networkd.conf's RouteTable= could define as a name (non-empty, no ':', not all digits). That leniency is documented. Register SafeAtoTerminal as a LITERAL for colouring. Tests cover every corner case confirmed with the real systemd parsers (sd-check), under both engines, including the highlighted ranges. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
feat/shared-terminals
branch
from
October 24, 2026 18:22
7e52763 to
fba690f
Compare
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.
Add SafeAtoTerminal, an exact model of systemd's safe_ato* family at 0f0682b773: signed/unsigned, base 0/8/10/16, the SAFE_ATO_REFUSE_* flags, BigInteger bounds up to the full 64-bit range, mangle_base's 0b/0o prefixes (with the sign and whitespace strtoul accepts after them), the disabled C23 0b support, and strtoul's modulo-2^64 wrap-around. Malformed input is a syntax error located where strtoul stops; out-of-range values are a semantic error on the number token. It works with both grammar engines, and valueOf() returns the stored value for predicates.
Add ROUTE_TABLE_FROM_STRING for manager_get_route_table_from_string(): the predefined names, a non-zero safe_atou32, or any value that networkd.conf's RouteTable= could define as a name (non-empty, no ':', not all digits). That leniency is documented.
Register SafeAtoTerminal as a LITERAL for colouring. Tests cover every corner case confirmed with the real systemd parsers (sd-check), under both engines, including the highlighted ranges.