tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Language additions from design revision 1: regions, @test, derive

- Regions (ADR 0002 Rev. 1): `region { }` expression; std/ref with
  Ref<h, a>, alloc<h> (new) and st<h> (get/set); escape check (E0701)
  on the region's value and outer variables; st labels of different
  regions may skip each other (reads/writes of enclosing regions), alloc
  never does; only regions handle alloc/st (E0702). Interpreter: a region
  is one handler frame for both effects and clears its references when
  it ends, breaking cycles. The unscoped `st` effect is removed.
- Type checker: a call's arguments are checked before its effects are
  performed (they run first and may fix the callee's type variables).
- Rust-style tests (ADR 0001 Rev. 1): @test functions anywhere in the
  package, @should_panic("fragment"); tilc test runs src/ and test/.
- @derive adds Debug (Rust's Debug format, quoting strings, field
  names), Hash (tag + fields) and Default (single constructor); prelude
  traits Debug/Hash/Default with built-in impls; Ord for Bool, List
  (lexicographic) and Option.
- Tests: run/regions (sum, cycle, nesting), run/derive, ui/regions,
  inline and should_panic tests in the CLI fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · e805f3ff2516e716aec059201c39d095dccd4158

Parents 0f6cde4

35 fichiers modifiés, 863 ajouts, 90 suppressions

Mcrates/tilc/tests/fixtures/pkg/src/util.til+8−0
Mcrates/tilc/tests/fixtures/pkg/test/util_test.til+10−2
Mcrates/tilc_core/src/interp.rs+108−20
Mcrates/tilc_syntax/src/grammar/expr.rs+8−1
Mcrates/tilc_syntax/src/syntax_kind.rs+4−0