Rex v0.3.0
Rex v0.3.0
This release expands the Rex language with a set of practical syntax and
compiler improvements focused on clearer code, less repetition, and better
support for common day-to-day patterns.
What's New
- Added compound assignment operators:
+=,-=,*=,/=,%= - Added compound assignment for indexed values such as:
v[0] += 1 - Added nested member assignment support such as:
o.inner.value = 99
and
o.inner.value += 1 - Added struct literals with named fields:
Vec2 { x: 3.0, y: 4.0 } - Added wildcard match arms using:
_ => ... - Added multi-tag match arms such as:
A | B => ...
Compiler and Typechecker Improvements
- Updated the parser, code generator, and typechecker to fully support the new syntax.
- Struct literal validation is now stricter:
unknown fields are rejected, duplicate fields are rejected, missing fields are
reported, and field types are checked. - Improved mutability and ownership checks for nested assignment paths.
- Improved method dispatch for nested member chains such as:
o.inner.get()
New Examples
rex/examples/test_compound_assign.rexrex/examples/test_multi_match.rexrex/examples/test_nested_assign.rexrex/examples/test_struct_lit.rexrex/examples/test_wildcard_match.rex