feat: Handle literal comparisons that use = and comprehensions without loops

- emit AssertCondition for equality-only assignment plans (outside soft-assert mode) so rules like `0 = 1` fail under the VM just like the interpreter
- let comprehension bodies consume assertion failures by advancing or exiting their iteration context, both in run-to-completion and suspendable execution

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-03 12:59:58 -06:00
parent 8269968c4a
commit bedf667adc
6 changed files with 127 additions and 26 deletions

View File

@@ -99,6 +99,9 @@ impl<'a> Compiler<'a> {
},
span,
);
if !self.soft_assert_mode {
self.emit_instruction(Instruction::AssertCondition { condition: dest }, span);
}
Ok(dest)
}
AssignmentPlan::WildcardMatch {