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: `multi ctl` operations, on both backends (issue #49)

A `multi ctl` clause may call `resume` several times; each call runs a
copy of the rest of the handled computation (ADR 0017). Plain `ctl`
stays one-shot and compiles as before.

- Syntax: a `multi` keyword before `ctl` (tree-sitter too); typed like
  a `ctl` clause.
- Interpreter: `resume` copies the captured frames.
- Native: `tl_handle_multi`/`tl_perform_multi`. A capture is saved as a
  snapshot of the fiber's stack and written back at the same address.
  The last use of `resume` runs the capture itself; any other runs a
  copy, made by a copying pass: the frames' unwinding code dups instead
  of dropping (`TL_UNWIND_DROP`, `TL_YIELD_CLONE`), then the snapshot is
  written back. Regions count their copies; `defer` cleanups run once
  per copy that leaves, and a never-resumed capture is cancelled.
  Reuse tokens are reused only if unique, since copies share them.
- Limits, with the same panics on both backends: a continuation holding
  another `ctl` handler, and `resume` while the body runs.
- Tests: tests/run/multishot.til (all results of choose/fail, N-queens,
  cleanups, shared references, cancellation), multishot_nested.til,
  multishot_running.til, tests/ui/multishot.til, a fiber snapshot test.

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

olivier · il y a 1 mois · f993d9ac61787bcf99a318b2af7ec1d9783fcf97

Parents c4b0172

32 fichiers modifiés, 3666 ajouts, 2715 suppressions

Mcrates/tilc_codegen_c/src/emit.rs+25−14
Mcrates/tilc_syntax/src/grammar/mod.rs+3−3
Mcrates/tilc_syntax/src/syntax_kind.rs+4−0
Meditors/tree-sitter-tilcayo/grammar.js+1−1
Meditors/tree-sitter-tilcayo/queries/helix/highlights.scm+1−1
Meditors/tree-sitter-tilcayo/queries/highlights.scm+1−1
Meditors/tree-sitter-tilcayo/src/grammar.json+13−0
Meditors/tree-sitter-tilcayo/src/node-types.json+4−0
Meditors/tree-sitter-tilcayo/src/parser.c+2665−2601
Meditors/tree-sitter-tilcayo/test/corpus/effects.txt+20−0