Skip to content

feat: standardize boolean literals to lowercase true/false everywhere - #82

Merged
Kinflou merged 2 commits into
masterfrom
feat/standardize-boolean-literal-lowercase
Oct 11, 2026
Merged

Kinflou merged 2 commits into
masterfrom
feat/standardize-boolean-literal-lowercase

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Three independent "boolean" surfaces disagreed: .ids settings values required capitalized True/False, .idp package config required lowercase true/false, and .ids annotation/expression values (@deprecated = true, validator keyword args, field defaults) had no dedicated bool type at all — just an unconstrained Identifier, guessed at downstream by inconsistent string comparisons.
  • BoolLiteral's leaf text is now "true"/"false" (still two literal leaves, not a combined regex — that's what keeps it unambiguous with Identifier).
  • Expression gained a Bool(BoolLiteral) variant, reusing the exact same type as SettingValue::Bool, so a boolean is spelled and typed identically in settings blocks and in annotation/expression values.
  • .idp's own BooleanLiteral converted from a single combined-regex leaf to the same two-literal-leaf shape — it had a live, only defensively-patched ambiguity with Identifier in freezing.rs (matched both Value::Boolean and Value::Identifier for "true"/"false" because nobody was sure which one the parser actually produced); now that it's unambiguous, the defensive Identifier arms are gone.
  • value_category's dual-case leniency (accepting both true/false and True/False) is dropped — only lowercase can occur from a conforming parse now.
  • This is a breaking change to .ids syntax: any schema with True/False in a settings {} block now needs lowercase.

Test plan

  • cargo test clean (341 + 188 + others, 0 failed)
  • cargo clippy --all-targets clean (no new warnings)
  • Verified end-to-end against the real comline CLI (via a temporary local [patch], reverted after): capitalized True in a .allowed setting now fails with an accurate settings::malformed-value error ("a settings '.allowed' key only accepts 'true' or 'false'" — previously that message was wrong for .ids); lowercase true passes cleanly; @deprecated = true still warns as a bare marker (confirmed it now parses through Expression::Bool, not Identifier)

Kinflou added 2 commits October 11, 2026 22:09
Three independent "boolean" surfaces disagreed with each other:
.ids settings values required capitalized True/False, .idp package
config required lowercase true/false, and .ids annotation/expression
values (@deprecated = true, validator keyword args, field defaults)
had no dedicated bool type at all - just an unconstrained Identifier,
guessed at downstream by inconsistent string comparisons.

- BoolLiteral's leaf text is now "true"/"false" (still two literal
  leaves, not a combined regex - that's what keeps it unambiguous with
  Identifier).
- Expression gained a Bool(BoolLiteral) variant, reusing the exact
  same type as SettingValue::Bool, so a boolean is spelled and typed
  identically in settings blocks and in annotation/expression values.
- .idp's own BooleanLiteral converted from a single combined-regex
  leaf to the same two-literal-leaf shape - it had a live, only
  defensively-patched ambiguity with Identifier (freezing.rs matched
  both Value::Boolean and Value::Identifier for "true"/"false" because
  nobody was sure which one the parser actually produced); now that
  it's unambiguous, the defensive Identifier arms are gone.
- value_category's dual-case leniency (accepting both true/false and
  True/False) is dropped - only lowercase can occur from a conforming
  parse now.
@Kinflou
Kinflou merged commit d8fcae0 into master Oct 11, 2026
9 checks passed
@Kinflou
Kinflou deleted the feat/standardize-boolean-literal-lowercase branch October 11, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant