Skip to content

v0.16.18

@MenkeTechnologies MenkeTechnologies tagged this 06 Jun 03:49
What's in this release:
- parser: `const var $x = …` / `frozen var $x = …` / `const val` /
  `frozen val` / `typed var $x : Int = …` / `typed val $x : Int = …` —
  the `const` / `frozen` / `typed` modifiers now compose with `var` /
  `val` exactly the way they compose with `my`. The practical addition
  is `const var $x = …` (use when the surrounding code spells mutable
  lexicals with `var` and you want a frozen exception without
  introducing the `val` spelling); the other combinations exist for
  symmetry so the modifier × declarator matrix has no gaps. `val` is
  already frozen on its own; `const val` / `frozen val` are idempotent
  (the post-parse frozen-flag loop runs either way). `typed val $x : Int`
  keeps val's frozen flag through the typed prefix.

  - `parser.rs::parse_statement` "frozen" | "const" arm: lookahead now
    accepts `my | var | val`. Error message updated.
  - same arm for `typed`. `typed val` also marks decls frozen so the
    composition matches `const typed my`.
  - tests/suite/parse_accepts.rs: six parse-positive pins
    (`accepts_{const,frozen,typed}_{var,val}`).

Verification:
  stryke -e 'const var $x = 1; $x = 2'
  # cannot assign to frozen variable `$x`   ✓ (was a parse error pre-fix)
  stryke -e 'typed val $x : Int = 1; $x = 2'
  # cannot assign to frozen variable `$x`   ✓
  cargo test --test integration accepts_const accepts_frozen accepts_typed
  # 6/6 green
Assets 2
Loading