@@ -371,7 +371,7 @@ struct LoConstDef {
371371pub struct CodeGen {
372372 pub errors : LoErrorManager ,
373373
374- mode : CompilerMode ,
374+ mode : LoCommand ,
375375 pub fm : FileManager ,
376376
377377 type_defs : Vec < LoTypeDef > ,
@@ -396,7 +396,7 @@ pub struct CodeGen {
396396}
397397
398398impl CodeGen {
399- pub fn new ( mode : CompilerMode ) -> Self {
399+ pub fn new ( mode : LoCommand ) -> Self {
400400 let mut codegen = Self :: default ( ) ;
401401 codegen. mode = mode;
402402 codegen. type_defs . push ( LoTypeDef {
@@ -478,7 +478,7 @@ impl CodeGen {
478478 loc : LoLocation :: internal ( ) ,
479479 } ) ;
480480
481- if codegen. mode == CompilerMode :: Inspect {
481+ if codegen. mode == LoCommand :: Inspect {
482482 stdout_writeln ( "[" ) ;
483483 }
484484
@@ -790,7 +790,7 @@ impl CodeGen {
790790 GlobalDefValue :: DataSize => LoType :: U32 ,
791791 } ;
792792
793- if self . mode == CompilerMode :: Inspect {
793+ if self . mode == LoCommand :: Inspect {
794794 let global_name = & global. global_name . repr ;
795795
796796 self . print_inspection ( & InspectInfo {
@@ -821,7 +821,7 @@ impl CodeGen {
821821 let mut const_ctx = LoExprContext :: default ( ) ;
822822 let code_unit = self . build_code_unit ( & mut const_ctx, & const_def. const_value ) ?;
823823
824- if self . mode == CompilerMode :: Inspect {
824+ if self . mode == LoCommand :: Inspect {
825825 let const_name = & const_def. const_name . repr ;
826826 let const_type = & code_unit. lo_type ;
827827
@@ -1074,7 +1074,7 @@ impl CodeGen {
10741074
10751075 wasm_module. types . append ( & mut self . wasm_types . borrow_mut ( ) ) ;
10761076
1077- if self . mode == CompilerMode :: Inspect {
1077+ if self . mode == LoCommand :: Inspect {
10781078 stdout_writeln ( "{ \" type\" : \" end\" }" ) ;
10791079 stdout_writeln ( "]" ) ;
10801080 }
@@ -1429,7 +1429,7 @@ impl CodeGen {
14291429
14301430 CodeExpr :: Ident ( ident) => {
14311431 if let Some ( const_def) = self . get_const ( ctx, & ident. repr ) {
1432- if self . mode == CompilerMode :: Inspect {
1432+ if self . mode == LoCommand :: Inspect {
14331433 self . print_inspection ( & InspectInfo {
14341434 message : format ! (
14351435 "const {}: {}" ,
@@ -2097,7 +2097,7 @@ impl CodeGen {
20972097 } ) ;
20982098 }
20992099
2100- if self . mode == CompilerMode :: Inspect {
2100+ if self . mode == LoCommand :: Inspect {
21012101 let params = ListDisplay ( & lo_fn_info. fn_params ) ;
21022102 let return_type = & lo_fn_info. fn_type . output ;
21032103 self . print_inspection ( & InspectInfo {
@@ -2275,7 +2275,7 @@ impl CodeGen {
22752275 Some ( & mut lo_type_args) ,
22762276 ) ?;
22772277
2278- if self . mode == CompilerMode :: Inspect {
2278+ if self . mode == LoCommand :: Inspect {
22792279 let lo_type_args = ListDisplay ( & lo_type_args) ;
22802280
22812281 let mut macro_args = Vec :: new ( ) ;
@@ -2926,7 +2926,7 @@ impl CodeGen {
29262926 loc : LoLocation ,
29272927 linked_loc : Option < LoLocation > ,
29282928 ) -> LoVariableInfo {
2929- let inspect_info = if self . mode == CompilerMode :: Inspect {
2929+ let inspect_info = if self . mode == LoCommand :: Inspect {
29302930 Some ( InspectInfo {
29312931 message : format ! ( "let {}: {}" , local_name, local_type) ,
29322932 loc : loc. clone ( ) ,
@@ -2962,7 +2962,7 @@ impl CodeGen {
29622962 return Ok ( LoVariableInfo :: Global {
29632963 global_index : global. global_index ,
29642964 global_type : global. global_type . clone ( ) ,
2965- inspect_info : if self . mode == CompilerMode :: Inspect {
2965+ inspect_info : if self . mode == LoCommand :: Inspect {
29662966 Some ( InspectInfo {
29672967 message : format ! ( "global {}: {}" , ident. repr, global. global_type) ,
29682968 loc : ident. loc . clone ( ) ,
@@ -2989,7 +2989,7 @@ impl CodeGen {
29892989
29902990 let field = self . get_struct_or_struct_ref_field ( ctx, & lhs_type, field_access) ?;
29912991
2992- let inspect_info = if self . mode == CompilerMode :: Inspect {
2992+ let inspect_info = if self . mode == LoCommand :: Inspect {
29932993 Some ( InspectInfo {
29942994 message : format ! ( "{}.{}: {}" , lhs_type, field. field_name, field. field_type) ,
29952995 loc : field_access. field_name . loc . clone ( ) ,
@@ -3148,7 +3148,7 @@ impl CodeGen {
31483148 let addr_type = self . get_expr_type ( ctx, addr_expr) ?;
31493149
31503150 if let LoType :: Pointer { pointee } = & addr_type {
3151- let inspect_info = if self . mode == CompilerMode :: Inspect {
3151+ let inspect_info = if self . mode == LoCommand :: Inspect {
31523152 Some ( InspectInfo {
31533153 message : format ! ( "<deref>: {}" , pointee) ,
31543154 loc : op_loc. clone ( ) ,
@@ -3488,7 +3488,7 @@ impl CodeGen {
34883488
34893489 // TODO: don't use tuples
34903490 fn process_const_string ( & self , value : String , loc : & LoLocation ) -> Result < ( u32 , u32 ) , LoError > {
3491- if self . memory . is_none ( ) && self . mode != CompilerMode :: Inspect {
3491+ if self . memory . is_none ( ) && self . mode != LoCommand :: Inspect {
34923492 return Err ( LoError {
34933493 message : format ! ( "Cannot use strings with no memory defined" ) ,
34943494 loc : loc. clone ( ) ,
@@ -3533,7 +3533,7 @@ impl CodeGen {
35333533
35343534 fn get_type_or_err ( & self , type_name : & str , loc : & LoLocation ) -> Result < LoType , LoError > {
35353535 if let Some ( typedef) = self . get_typedef ( type_name) {
3536- if self . mode == CompilerMode :: Inspect {
3536+ if self . mode == LoCommand :: Inspect {
35373537 if typedef. loc . file_index != 0 {
35383538 if typedef. type_alias {
35393539 self . print_inspection ( & InspectInfo {
0 commit comments