File tree Expand file tree Collapse file tree 2 files changed +188
-98
lines changed Expand file tree Collapse file tree 2 files changed +188
-98
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use std::rc::Rc;
7
7
8
8
use thiserror:: Error ;
9
9
10
+ use self :: op_code:: OffsetDirection ;
10
11
pub use crate :: executor:: op_code:: OpCode ;
11
12
use crate :: {
12
13
class:: {
@@ -21,8 +22,6 @@ use crate::{
21
22
heap:: Heap ,
22
23
} ;
23
24
24
- use self :: op_code:: OffsetDirection ;
25
-
26
25
pub struct ExecutorFrame {
27
26
frame : Frame ,
28
27
pc : ProgramCounter ,
@@ -121,12 +120,12 @@ pub fn run(code: &Code, heap: &mut Heap) {
121
120
} ;
122
121
current_pc. next ( 1 ) . unwrap ( ) ;
123
122
} ,
124
- Update :: GoTo ( offset, direction) => {
125
- match direction {
126
- OffsetDirection :: Forward => current_pc . next ( offset ) . unwrap ( ) ,
127
- OffsetDirection :: Backward => current_pc. previous ( offset) . unwrap ( ) ,
128
- }
129
- }
123
+ Update :: GoTo ( offset, direction) => match direction {
124
+ OffsetDirection :: Forward => current_pc . next ( offset ) . unwrap ( ) ,
125
+ OffsetDirection :: Backward => {
126
+ current_pc. previous ( offset) . unwrap ( )
127
+ } ,
128
+ } ,
130
129
}
131
130
}
132
131
}
You can’t perform that action at this time.
0 commit comments