@@ -19,15 +19,15 @@ use std::fmt::{self, Display, Formatter, Octal, Write};
1919use std:: hash:: Hash ;
2020use std:: ops:: { Shl , Shr } ;
2121
22- use tracing:: { event , Level } ;
22+ use tracing:: { Level , event } ;
2323
24- use base:: charset:: { subscript_char , superscript_char , Script } ;
24+ use base:: charset:: { Script , subscript_char , superscript_char } ;
2525use base:: prelude:: * ;
2626use base:: u18;
2727
2828use super :: collections:: OneOrMore ;
2929use super :: eval:: {
30- symbol_name_lookup , Evaluate , EvaluationContext , HereValue , SymbolLookupFailure ,
30+ Evaluate , EvaluationContext , HereValue , SymbolLookupFailure , symbol_name_lookup ,
3131} ;
3232use super :: glyph;
3333use super :: listing:: { Listing , ListingLine } ;
@@ -40,9 +40,9 @@ use super::source::Source;
4040use super :: span:: * ;
4141use super :: symbol:: { InconsistentSymbolUse , SymbolContext , SymbolName } ;
4242use super :: symtab:: {
43- record_undefined_symbol_or_return_failure , BadSymbolDefinition , ExplicitDefinition ,
44- ExplicitSymbolTable , FinalSymbolDefinition , FinalSymbolTable , FinalSymbolType ,
45- ImplicitSymbolTable , IndexRegisterAssigner , TagDefinition ,
43+ BadSymbolDefinition , ExplicitDefinition , ExplicitSymbolTable , FinalSymbolDefinition ,
44+ FinalSymbolTable , FinalSymbolType , ImplicitSymbolTable , IndexRegisterAssigner , TagDefinition ,
45+ record_undefined_symbol_or_return_failure ,
4646} ;
4747use super :: types:: * ;
4848mod eval;
@@ -201,7 +201,8 @@ impl SignedAtom {
201201 & self ,
202202 block_id : BlockIdentifier ,
203203 block_offset : Unsigned18Bit ,
204- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
204+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
205+ {
205206 self . magnitude . symbol_uses ( block_id, block_offset)
206207 }
207208
@@ -308,7 +309,8 @@ impl ArithmeticExpression {
308309 & self ,
309310 block_id : BlockIdentifier ,
310311 block_offset : Unsigned18Bit ,
311- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
312+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
313+ {
312314 let mut result = Vec :: with_capacity ( 1 + self . tail . len ( ) ) ;
313315 result. extend ( self . first . symbol_uses ( block_id, block_offset) ) ;
314316 result. extend (
@@ -339,7 +341,9 @@ impl ArithmeticExpression {
339341 Operator :: Subtract => match left. checked_sub ( right) {
340342 Some ( result) => result,
341343 None => {
342- todo ! ( "subtraction overflow occurred in {left}-{right} but this is not implemented" )
344+ todo ! (
345+ "subtraction overflow occurred in {left}-{right} but this is not implemented"
346+ )
343347 }
344348 } ,
345349 Operator :: Multiply => match left. checked_mul ( right) {
@@ -445,7 +449,8 @@ impl ConfigValue {
445449 & self ,
446450 block_id : BlockIdentifier ,
447451 block_offset : Unsigned18Bit ,
448- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
452+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
453+ {
449454 self . expr
450455 . symbol_uses ( block_id, block_offset)
451456 . map ( |r| match r {
@@ -578,7 +583,9 @@ impl Spanned for RegistersContaining {
578583 match it. next ( ) {
579584 Some ( rc) => it. fold ( rc. span ( ) , |acc, rc| acc. union ( rc. span ( ) ) ) ,
580585 None => {
581- unreachable ! ( "invariant broken: RegistersContaining contains no RegisterContaining instances" )
586+ unreachable ! (
587+ "invariant broken: RegistersContaining contains no RegisterContaining instances"
588+ )
582589 }
583590 }
584591 }
@@ -638,7 +645,9 @@ impl RegisterContaining {
638645 // words.
639646 }
640647 SymbolUse :: Definition ( ExplicitDefinition :: Origin ( _, _) ) => {
641- unreachable ! ( "Found origin {name} inside an RC-word; the parser should have rejected this." ) ;
648+ unreachable ! (
649+ "Found origin {name} inside an RC-word; the parser should have rejected this."
650+ ) ;
642651 }
643652 SymbolUse :: Definition ( _) => {
644653 // e.g. we have an input like
@@ -655,7 +664,9 @@ impl RegisterContaining {
655664 // When working on this case we should
656665 // figure out if an equality is allowed
657666 // inside a macro expansion.
658- panic ! ( "Found unexpected definition of {name} inside RC-word reference at {span:?}" ) ;
667+ panic ! (
668+ "Found unexpected definition of {name} inside RC-word reference at {span:?}"
669+ ) ;
659670 }
660671 }
661672 }
@@ -776,7 +787,8 @@ impl Atom {
776787 & self ,
777788 block_id : BlockIdentifier ,
778789 block_offset : Unsigned18Bit ,
779- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<> {
790+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<>
791+ {
780792 let mut result: Vec < Result < _ , _ > > = Vec :: with_capacity ( 1 ) ;
781793 match self {
782794 Atom :: SymbolOrLiteral ( SymbolOrLiteral :: Symbol ( script, name, span) ) => {
@@ -933,7 +945,8 @@ pub(crate) enum SymbolOrLiteral {
933945impl SymbolOrLiteral {
934946 fn symbol_uses (
935947 & self ,
936- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
948+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
949+ {
937950 let mut result = Vec :: with_capacity ( 1 ) ;
938951 match self {
939952 SymbolOrLiteral :: Here ( _, _) | SymbolOrLiteral :: Literal ( _) => ( ) ,
@@ -1101,7 +1114,8 @@ impl InstructionFragment {
11011114 & self ,
11021115 block_id : BlockIdentifier ,
11031116 block_offset : Unsigned18Bit ,
1104- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<> {
1117+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<>
1118+ {
11051119 let mut uses: Vec < Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > =
11061120 Vec :: new ( ) ;
11071121 match self {
@@ -1172,7 +1186,9 @@ impl InstructionFragment {
11721186 rc_word_value,
11731187 } ) ,
11741188 SymbolSubstitution :: Hit ( _span, _script, _arithmetic_expression) => {
1175- todo ! ( "macro parameter expansion is not yet fully supported in the index part of pipe constructs" )
1189+ todo ! (
1190+ "macro parameter expansion is not yet fully supported in the index part of pipe constructs"
1191+ )
11761192 }
11771193 SymbolSubstitution :: Omit => None ,
11781194 SymbolSubstitution :: Zero ( span) => Some ( InstructionFragment :: Null ( span) ) ,
@@ -1282,7 +1298,8 @@ impl Origin {
12821298 pub ( super ) fn symbol_uses(
12831299 & self ,
12841300 block_id : BlockIdentifier ,
1285- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<> {
1301+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<>
1302+ {
12861303 let mut result = Vec :: with_capacity ( 1 ) ;
12871304 match self {
12881305 Origin :: Literal ( _span, _) => ( ) ,
@@ -1581,7 +1598,8 @@ impl Tag {
15811598 & self ,
15821599 block_id : BlockIdentifier ,
15831600 block_offset : Unsigned18Bit ,
1584- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
1601+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
1602+ {
15851603 [ Ok ( (
15861604 self . name . clone ( ) ,
15871605 self . span ,
@@ -1621,7 +1639,8 @@ impl TaggedProgramInstruction {
16211639 & self ,
16221640 block_id : BlockIdentifier ,
16231641 offset : Unsigned18Bit ,
1624- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
1642+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
1643+ {
16251644 let mut result: Vec < Result < _ , _ > > = Vec :: new ( ) ;
16261645 result. extend (
16271646 self . tags
@@ -1809,7 +1828,8 @@ impl InstructionSequence {
18091828 pub ( crate ) fn symbol_uses(
18101829 & self ,
18111830 block_id : BlockIdentifier ,
1812- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<> {
1831+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use<>
1832+ {
18131833 let no_symbols = ExplicitSymbolTable :: default ( ) ;
18141834 let local_scope: & ExplicitSymbolTable = self . local_symbols . as_ref ( ) . unwrap_or ( & no_symbols) ;
18151835 let mut result: Vec < Result < _ , _ > > = Vec :: new ( ) ;
@@ -1859,7 +1879,9 @@ impl InstructionSequence {
18591879 }
18601880
18611881 if self . local_symbols . is_some ( ) {
1862- panic ! ( "InstructionSequence::build_binary_block: evaluation with local symbol tables is not yet implemented" ) ;
1882+ panic ! (
1883+ "InstructionSequence::build_binary_block: evaluation with local symbol tables is not yet implemented"
1884+ ) ;
18631885 }
18641886 let mut ctx = EvaluationContext {
18651887 explicit_symtab,
@@ -1903,7 +1925,8 @@ pub(crate) struct Equality {
19031925impl Equality {
19041926 pub ( super ) fn symbol_uses (
19051927 & self ,
1906- ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < > {
1928+ ) -> impl Iterator < Item = Result < ( SymbolName , Span , SymbolUse ) , InconsistentSymbolUse > > + use < >
1929+ {
19071930 [ Ok ( (
19081931 self . name . clone ( ) ,
19091932 self . span ,
0 commit comments