feat: Gleam-style multi-subject ? match#719
Merged
Merged
Conversation
Collaborator
Author
|
needs manual rebase (conflicts in: src/ast/mod.rs src/codegen/fmt.rs src/codegen/python.rs src/interpreter/mod.rs src/verify.rs src/vm/mod.rs) |
38f920c to
e2982be
Compare
|
Missing match arms in js.rs after rebasing onto commits that added Or-patterns (ILO-411) and Todo/Panic expressions (ILO-410). Treat Or-patterns as wildcard and forward Todo/Panic inner expression in JS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
?match:?a b{"ok" "ok":"both"; _ _:"miss"}— each arm has N space-separated patterns, one per subjectStmt::Match/Expr::Matchfieldsubject: Option<Expr>renamed tosubjects: Vec<Expr>; single-subject and subject-less forms are unchangedPattern::Tuple(Vec<Pattern>)variant for multi-subject arms; interpreter, register VM, verifier, and codegen (fmt + python) all updatedlooks_like_multi_subject+first_arm_has_n_patterns) prevents false-positive disambiguation against existing ternary hint shapes (ILO-P009 regression suite still green)Test plan
cargo test— all 5000+ tests pass (includingregression_ternary_brace_hint6/6)?a b{"ok" "ok":"both";_ _:"miss"}returns"both"via--vm?a b{"ok" "ok":"both";_ _:"miss"}with non-matching subjects returns"miss"50-match-multi-subject.iloaddedCloses
ILO-412
🤖 Generated with Claude Code