Pass tests
This commit is contained in:
parent
bfade78a0d
commit
b7153df9be
@ -695,9 +695,10 @@ impl<'src> Parser<'src> {
|
|||||||
|
|
||||||
self.emit_instruction(previous_instruction, previous_position);
|
self.emit_instruction(previous_instruction, previous_position);
|
||||||
self.emit_instruction(
|
self.emit_instruction(
|
||||||
Instruction::set_local(previous_instruction.a(), local_index),
|
Instruction::set_local(self.current_register, local_index),
|
||||||
start_position,
|
start_position,
|
||||||
);
|
);
|
||||||
|
self.increment_register()?;
|
||||||
|
|
||||||
self.parsed_expression = false;
|
self.parsed_expression = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -818,7 +818,7 @@ fn set_local() {
|
|||||||
(Instruction::define_local(0, 0, true), Span(8, 9)),
|
(Instruction::define_local(0, 0, true), Span(8, 9)),
|
||||||
(Instruction::load_constant(1, 1, false), Span(20, 22)),
|
(Instruction::load_constant(1, 1, false), Span(20, 22)),
|
||||||
(Instruction::set_local(1, 0), Span(16, 17)),
|
(Instruction::set_local(1, 0), Span(16, 17)),
|
||||||
(Instruction::get_local(1, 0), Span(24, 25)),
|
(Instruction::get_local(2, 0), Span(24, 25)),
|
||||||
(Instruction::r#return(true), Span(25, 25)),
|
(Instruction::r#return(true), Span(25, 25)),
|
||||||
],
|
],
|
||||||
vec![Value::integer(41), Value::integer(42)],
|
vec![Value::integer(41), Value::integer(42)],
|
||||||
|
Loading…
Reference in New Issue
Block a user