[fine] Panic embeds description, start match

This commit is contained in:
John Doty 2024-03-24 07:08:45 -07:00
parent 548d9387d6
commit 9ce5794c30
3 changed files with 94 additions and 35 deletions

View file

@ -59,7 +59,7 @@ fun attack(weapon: MeleeWeapon or RangedWeapon, monster: Monster, distance: f64)
// `and` that follows the declaration in the `is` still has the variables
// from the `is` binding in scope.
if weapon is MeleeWeapon and distance > 1 or
weapon is w : RangedWeapon and (distance < w.minRange or distance > w.maxRange) {
weapon is w:RangedWeapon and (distance < w.minRange or distance > w.maxRange) {
print("You are out of range");
return
}
@ -127,6 +127,12 @@ fun test() -> f64 {
sum = sum + v;
}
let it = new Iterator { current: 0 };
sum = sum + match it.next() {
v:f64 -> 100,
_ -> 1000,
};
// Unroll by hand...
let it = new Iterator { current: 0 };
while true {
@ -141,5 +147,6 @@ fun test() -> f64 {
// like the above.
}
// @ignore never finished compiling `match`
// @no-errors
// @ignore not finished yet, still compiler bugs
// @no-errors
// @eval: Float(90.0)