@@ -5,18 +5,14 @@ use gc::{Finalize, Trace};
5
5
6
6
use crate :: ast:: expression:: { Expression , IdentifierT } ;
7
7
use crate :: ast:: statement:: { BoxStatement , Statement , StatementList } ;
8
- use crate :: ast:: structs:: ClassDeclaration ;
9
- use crate :: errors:: { Descriptor , ErrorT , ResultWithError , RuntimeError } ;
8
+ use crate :: errors:: ResultWithError ;
10
9
use crate :: interpreter:: environment:: default_global_scope:: get_default_global_scope;
11
10
use crate :: interpreter:: environment:: statement_result:: { handle_unrolling, handle_unrolling_in_loop, StatementExecution , StatementMetaGeneration , UnrollingReason } ;
12
- use crate :: interpreter:: runtime_values:: { PrimitiveValue , ref_to_value:: RefToValue } ;
13
- use crate :: interpreter:: runtime_values:: objects:: runtime_object:: RuntimeObject ;
14
- use crate :: interpreter:: utils:: consts:: { OBJECT , SUPER } ;
11
+ use crate :: interpreter:: runtime_values:: PrimitiveValue ;
15
12
use crate :: interpreter:: utils:: consume_or_clone:: ConsumeOrCloneOf ;
16
- use crate :: interpreter:: utils:: get_object_superclass;
17
13
use crate :: interpreter:: variables_containers:: { GlobalScope , map:: { delegate_ivariables_map, IVariablesMap , IVariablesMapConstMembers , IVariablesMapDelegator } , VariableScope , VariablesMap } ;
18
14
use crate :: parser:: parse;
19
- use crate :: utils:: cell_ref:: { gc_box_from , gc_cell_clone, GcBox } ;
15
+ use crate :: utils:: cell_ref:: { gc_cell_clone, GcBox } ;
20
16
21
17
pub mod statement_result;
22
18
pub mod expression_evaluation;
@@ -93,20 +89,20 @@ impl Environment {
93
89
for decl in decls. iter ( ) {
94
90
self . hoist_identifier ( & decl. identifier ) ?;
95
91
}
96
- } ,
92
+ }
97
93
Statement :: FunctionDeclarationStatement ( fdecl) => {
98
94
self . declare (
99
95
& fdecl. name ,
100
- PrimitiveValue :: new_closure ( self , fdecl. clone ( ) ) . into ( )
96
+ PrimitiveValue :: new_closure ( self , fdecl. clone ( ) ) . into ( ) ,
101
97
) ?;
102
- } ,
98
+ }
103
99
Statement :: ClassDeclarationStatement ( cdecl) => {
104
100
let class = PrimitiveValue :: new_class_by_eval ( self , cdecl) ?;
105
101
self . declare (
106
102
& cdecl. name ,
107
- class. into ( )
103
+ class. into ( ) ,
108
104
) ?;
109
- } ,
105
+ }
110
106
_ => { }
111
107
}
112
108
return Ok ( StatementMetaGeneration :: NormalGeneration ) ;
@@ -215,13 +211,13 @@ impl Environment {
215
211
} ;
216
212
Ok ( StatementExecution :: Unrolling ( UnrollingReason :: ReturningValue ( res) ) )
217
213
}
218
- Statement :: ClassDeclarationStatement ( decl ) => {
214
+ Statement :: ClassDeclarationStatement ( .. ) => {
219
215
// Class declaration has already been hoisted
220
216
Ok ( StatementExecution :: NormalFlow )
221
- } ,
222
- stmt => {
223
- Err ( ErrorT :: UnimplementedStatementTypeForInterpreter ( stmt. clone ( ) ) . into ( ) )
224
217
}
218
+ /*stmt => {
219
+ Err(ErrorT::UnimplementedStatementTypeForInterpreter(stmt.clone()).into())
220
+ }*/
225
221
} ;
226
222
}
227
223
0 commit comments