@@ -91,14 +91,14 @@ fn assemble_pass1<'a, 'b: 'a>(
9191 let ( mut sf, mut new_errors) = parse_source_file ( source_file_body. as_str ( ) , setup) ;
9292 errors. append ( & mut new_errors) ;
9393
94- if let Some ( source_file) = sf. as_mut ( ) {
95- if let Err ( tag_errors) = source_file. build_local_symbol_tables ( ) {
96- errors . extend (
97- tag_errors
98- . into_iter ( )
99- . map ( |tag_err| Rich :: custom ( tag_err . span ( ) , tag_err . to_string ( ) ) ) ,
100- ) ;
101- }
94+ if let Some ( source_file) = sf. as_mut ( )
95+ && let Err ( tag_errors) = source_file. build_local_symbol_tables ( )
96+ {
97+ errors . extend (
98+ tag_errors
99+ . into_iter ( )
100+ . map ( |tag_err| Rich :: custom ( tag_err . span ( ) , tag_err . to_string ( ) ) ) ,
101+ ) ;
102102 }
103103 Ok ( ( sf, options) )
104104}
@@ -298,10 +298,10 @@ fn initial_symbol_table<'a>(
298298 for r in source_file. global_symbol_references ( ) {
299299 match r {
300300 Ok ( ( symbol, span, context) ) => {
301- if !explicit_symbols. is_defined ( & symbol) {
302- if let Err ( e) = implicit_symbols. record_usage_context ( symbol. clone ( ) , context) {
303- errors . push ( Rich :: custom ( span , e . to_string ( ) ) ) ;
304- }
301+ if !explicit_symbols. is_defined ( & symbol)
302+ && let Err ( e) = implicit_symbols. record_usage_context ( symbol. clone ( ) , context)
303+ {
304+ errors . push ( Rich :: custom ( span , e . to_string ( ) ) ) ;
305305 }
306306 }
307307 Err ( e) => {
@@ -461,15 +461,15 @@ fn assemble_pass3(
461461 let mut bad_symbol_definitions: BTreeMap < SymbolName , ProgramError > = Default :: default ( ) ;
462462 // TODO: consider moving this into pass 2.
463463 for block in blocks. values ( ) {
464- if let Some ( Origin :: Symbolic ( span, symbol_name) ) = block. origin . as_ref ( ) {
465- if !explicit_symtab. is_defined ( symbol_name) {
466- final_symbols . define_if_undefined (
467- symbol_name . clone ( ) ,
468- FinalSymbolType :: Tag , // actually origin
469- body . extract ( span . start ..span . end ) . to_string ( ) ,
470- FinalSymbolDefinition :: PositionIndependent ( block . location . into ( ) ) ,
471- ) ;
472- }
464+ if let Some ( Origin :: Symbolic ( span, symbol_name) ) = block. origin . as_ref ( )
465+ && !explicit_symtab. is_defined ( symbol_name)
466+ {
467+ final_symbols . define_if_undefined (
468+ symbol_name . clone ( ) ,
469+ FinalSymbolType :: Tag , // actually origin
470+ body . extract ( span . start ..span . end ) . to_string ( ) ,
471+ FinalSymbolDefinition :: PositionIndependent ( block . location . into ( ) ) ,
472+ ) ;
473473 }
474474 }
475475
0 commit comments