Skip to content

ILO-53: document and pin multi-statement function body chains#632

Merged
danieljohnmorris merged 1 commit into
mainfrom
feature/single-expr-statement-chain
May 22, 2026
Merged

ILO-53: document and pin multi-statement function body chains#632
danieljohnmorris merged 1 commit into
mainfrom
feature/single-expr-statement-chain

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

  • The parser already supported both inline (;-separated) and brace-block { stmt; ... } fn body forms; this PR makes that the official documented contract with a full regression gate
  • Adds examples/fn-body-multistep.ilo exercising bind-chain, braceless-guard early return, ret-based early return, and Result unwrap mid-body (v=call!)
  • Adds tests/regression_fn_body_multistep.rs — 18 cross-engine tests (VM + JIT) covering all three shapes the ticket requires
  • Updates SPEC.md Functions section and skills/ilo/ilo-language.md with explicit body-form documentation

Closes ILO-53.

Test plan

  • cargo test --test regression_fn_body_multistep — 18 tests pass (VM + JIT)
  • cargo test --test examples — fn-body-multistep.ilo run/out annotations pass
  • cargo test --lib — 3330 lib tests clean
  • All existing single-expression body tests continue to pass

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
688 1 687 0
View the full list of 1 ❄️ flaky test(s)
ilo::interpreter::tests::interpret_braced_guard_in_loop_no_early_return

Flake rate in main: 66.67% (Passed 1 times, Failed 2 times)

Stack Traces | 0.01s run time
thread 'interpreter::tests::interpret_braced_guard_in_loop_no_early_return' (32878) panicked at src/interpreter/mod.rs:10202:9:
parse errors: [ParseError { code: "ILO-P003", position: 27, span: Span { start: 35, end: 36 }, message: "expected `{`, got `;`", hint: Some("ilo bodies are single-line, `;`-separated — not python/swift-style indented. Use either the brace-block form `name p:t>r;{body1;body2}` or the single-line form `name p:t>r;body1;body2`. For statements that require a block (`@k xs{...}`, `wh cond{...}`, `?subj{...}`), the `{...}` must be on the same line as the head.") }]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@danieljohnmorris
Copy link
Copy Markdown
Collaborator Author

needs manual rebase (conflicts in: tests/regression_fn_body_multistep.rs)

@danieljohnmorris
Copy link
Copy Markdown
Collaborator Author

needs manual — rebase conflict in non-doc file(s)

hotfix(codegen/js): handle Pattern::Or, Expr::Todo, Expr::Panic
@danieljohnmorris danieljohnmorris force-pushed the feature/single-expr-statement-chain branch from e5f792a to d57d563 Compare May 22, 2026 10:36
@danieljohnmorris danieljohnmorris merged commit a957606 into main May 22, 2026
7 of 11 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/single-expr-statement-chain branch May 22, 2026 10:40
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