update stack discipline in dict patterns
This commit is contained in:
parent
f9e4b4623b
commit
f576868a7a
15
sandbox.ld
15
sandbox.ld
|
@ -1,14 +1,3 @@
|
|||
let command = [:forward, 100]
|
||||
|
||||
match command with {
|
||||
(:goto, (x, y)) -> "goto: {x} and {y}"
|
||||
[:one, :two] -> :no
|
||||
(:home) -> "go home!"
|
||||
& (:clear) -> "clear the screen"
|
||||
& (:right, turns) -> "make {turns} to the right"
|
||||
& (:left, turns) -> "turn left! by {turns}"
|
||||
(:forward, steps) -> "forward {steps} turtle paces"
|
||||
(:back, steps) -> "flip it and reverse it {steps}"
|
||||
[...xs] -> :splatted
|
||||
}
|
||||
let #{a, b, ...} = #{:a 1, :b 2, :c 3}
|
||||
|
||||
(a, b)
|
||||
|
|
|
@ -739,8 +739,9 @@ impl<'a> Compiler<'a> {
|
|||
self.patch_jump(idx, self.len() - idx - 3);
|
||||
}
|
||||
|
||||
self.emit_op(Op::PopN);
|
||||
self.emit_byte(pairs.len());
|
||||
self.pop_n(pairs.len());
|
||||
// self.emit_op(Op::PopN);
|
||||
// self.emit_byte(pairs.len());
|
||||
|
||||
self.patch_jump(before_load_dict_idx, self.len() - before_load_dict_idx - 3);
|
||||
self.patch_jump(jump_idx, self.len() - jump_idx - 3);
|
||||
|
|
Loading…
Reference in New Issue
Block a user