@@ -94,7 +94,7 @@ pub enum Tag {
9494// - stay shared as long as possible
9595// - bring shared information to the front (bulk)
9696
97- #[ inline( always ) ]
97+ #[ inline]
9898pub const fn item_byte ( b : Tag ) -> u8 {
9999 match b {
100100 Tag :: NewVar => { 0b1100_0000 | 0 }
@@ -104,7 +104,7 @@ pub const fn item_byte(b: Tag) -> u8 {
104104 }
105105}
106106
107- #[ inline( always ) ]
107+ #[ inline]
108108pub fn byte_item ( b : u8 ) -> Tag {
109109 if b == 0b1100_0000 { return Tag :: NewVar ; }
110110 else if ( b & 0b1100_0000 ) == 0b1100_0000 { return Tag :: SymbolSize ( b & 0b0011_1111 ) }
@@ -197,12 +197,12 @@ macro_rules! traverse {
197197 ( $t1: ty, $t2: ty, $x: expr, $new_var: expr, $var_ref: expr, $symbol: expr, $zero: expr, $add: expr, $finalize: expr) => { {
198198 struct AnonTraversal { }
199199 impl Traversal <$t1, $t2> for AnonTraversal {
200- #[ inline( always ) ] fn new_var( & mut self , offset: usize ) -> $t2 { ( $new_var) ( offset) }
201- #[ inline( always ) ] fn var_ref( & mut self , offset: usize , i: u8 ) -> $t2 { ( $var_ref) ( offset, i) }
202- #[ inline( always ) ] fn symbol( & mut self , offset: usize , s: & [ u8 ] ) -> $t2 { ( $symbol) ( offset, s) }
203- #[ inline( always ) ] fn zero( & mut self , offset: usize , a: u8 ) -> $t1 { ( $zero) ( offset, a) }
204- #[ inline( always ) ] fn add( & mut self , offset: usize , acc: $t1, sub: $t2) -> $t1 { ( $add) ( offset, acc, sub) }
205- #[ inline( always ) ] fn finalize( & mut self , offset: usize , acc: $t1) -> $t2 { ( $finalize) ( offset, acc) }
200+ #[ inline] fn new_var( & mut self , offset: usize ) -> $t2 { ( $new_var) ( offset) }
201+ #[ inline] fn var_ref( & mut self , offset: usize , i: u8 ) -> $t2 { ( $var_ref) ( offset, i) }
202+ #[ inline] fn symbol( & mut self , offset: usize , s: & [ u8 ] ) -> $t2 { ( $symbol) ( offset, s) }
203+ #[ inline] fn zero( & mut self , offset: usize , a: u8 ) -> $t1 { ( $zero) ( offset, a) }
204+ #[ inline] fn add( & mut self , offset: usize , acc: $t1, sub: $t2) -> $t1 { ( $add) ( offset, acc, sub) }
205+ #[ inline] fn finalize( & mut self , offset: usize , acc: $t1) -> $t2 { ( $finalize) ( offset, acc) }
206206 }
207207
208208 execute_loop( & mut AnonTraversal { } , $x, 0 ) . 1
@@ -994,15 +994,15 @@ let mut stack: Vec<(u8, A)> = Vec::with_capacity(8);
994994struct DebugTraversal { string : String , transient : bool }
995995#[ allow( unused_variables) ]
996996impl Traversal < ( ) , ( ) > for DebugTraversal {
997- #[ inline( always ) ] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '$' ) ; }
998- #[ inline( always ) ] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '_' ) ; self . string . push_str ( ( i as u16 + 1 ) . to_string ( ) . as_str ( ) ) ; }
999- #[ inline( always ) ] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { match std:: str:: from_utf8 ( s) {
997+ #[ inline] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '$' ) ; }
998+ #[ inline] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '_' ) ; self . string . push_str ( ( i as u16 + 1 ) . to_string ( ) . as_str ( ) ) ; }
999+ #[ inline] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { match std:: str:: from_utf8 ( s) {
10001000 Ok ( string) => { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push_str ( string) ; }
10011001 Err ( _) => { if self . transient { self . string . push ( ' ' ) ; } ; for b in s { self . string . push_str ( format ! ( "\\ x{:x}" , b) . as_str ( ) ) ; } ; }
10021002 } }
1003- #[ inline( always ) ] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '(' ) ; self . transient = false ; }
1004- #[ inline( always ) ] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1005- #[ inline( always ) ] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . string . push ( ')' ) ; }
1003+ #[ inline] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . string . push ( ' ' ) ; } ; self . string . push ( '(' ) ; self . transient = false ; }
1004+ #[ inline] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1005+ #[ inline] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . string . push ( ')' ) ; }
10061006}
10071007
10081008impl Debug for Expr {
@@ -1016,59 +1016,59 @@ impl Debug for Expr {
10161016struct SerializerTraversal < ' a , Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str > { out : & ' a mut Target , map_symbol : F , transient : bool }
10171017#[ allow( unused_variables, unused_must_use) ]
10181018impl < Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str > Traversal < ( ) , ( ) > for SerializerTraversal < ' _ , Target , F > {
1019- #[ inline( always ) ] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "$" . as_bytes ( ) ) ; }
1020- #[ inline( always ) ] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "_" . as_bytes ( ) ) ; self . out . write ( ( i as u16 + 1 ) . to_string ( ) . as_bytes ( ) ) ; }
1021- #[ inline( always ) ] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_symbol ) ( s) . as_bytes ( ) ) ; }
1022- #[ inline( always ) ] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "(" . as_bytes ( ) ) ; self . transient = false ; }
1023- #[ inline( always ) ] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1024- #[ inline( always ) ] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . out . write ( ")" . as_bytes ( ) ) ; }
1019+ #[ inline] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "$" . as_bytes ( ) ) ; }
1020+ #[ inline] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "_" . as_bytes ( ) ) ; self . out . write ( ( i as u16 + 1 ) . to_string ( ) . as_bytes ( ) ) ; }
1021+ #[ inline] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_symbol ) ( s) . as_bytes ( ) ) ; }
1022+ #[ inline] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "(" . as_bytes ( ) ) ; self . transient = false ; }
1023+ #[ inline] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1024+ #[ inline] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . out . write ( ")" . as_bytes ( ) ) ; }
10251025}
10261026
10271027struct SerializerTraversal2 < ' a , Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str , G : Fn ( u8 , bool ) -> & ' static str > { out : & ' a mut Target , map_symbol : F , map_variable : G , transient : bool , n : u8 }
10281028#[ allow( unused_variables, unused_must_use) ]
10291029impl < Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str , G : Fn ( u8 , bool ) -> & ' static str > Traversal < ( ) , ( ) > for SerializerTraversal2 < ' _ , Target , F , G > {
1030- #[ inline( always ) ] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_variable ) ( self . n , true ) . as_bytes ( ) ) ; self . n += 1 ; }
1031- #[ inline( always ) ] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_variable ) ( i, false ) . as_bytes ( ) ) ; }
1032- #[ inline( always ) ] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_symbol ) ( s) . as_bytes ( ) ) ; }
1033- #[ inline( always ) ] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "(" . as_bytes ( ) ) ; self . transient = false ; }
1034- #[ inline( always ) ] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1035- #[ inline( always ) ] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . out . write ( ")" . as_bytes ( ) ) ; }
1030+ #[ inline] fn new_var ( & mut self , offset : usize ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_variable ) ( self . n , true ) . as_bytes ( ) ) ; self . n += 1 ; }
1031+ #[ inline] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_variable ) ( i, false ) . as_bytes ( ) ) ; }
1032+ #[ inline] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( ( self . map_symbol ) ( s) . as_bytes ( ) ) ; }
1033+ #[ inline] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ; self . out . write ( "(" . as_bytes ( ) ) ; self . transient = false ; }
1034+ #[ inline] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { self . transient = true ; }
1035+ #[ inline] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { self . out . write ( ")" . as_bytes ( ) ) ; }
10361036}
10371037
10381038struct SerializerTraversalHighlights < ' a , ' t , Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str , G : Fn ( u8 , bool ) -> & ' static str > { out : & ' a mut Target , map_symbol : F , map_variable : G , transient : bool , n : u8 , targets : & ' t [ ( usize , & ' static str , & ' static str ) ] }
10391039#[ allow( unused_variables, unused_must_use) ]
10401040impl < Target : std:: io:: Write , F : for < ' b > Fn ( & ' b [ u8 ] ) -> & ' b str , G : Fn ( u8 , bool ) -> & ' static str > Traversal < Option < & ' static str > , ( ) > for SerializerTraversalHighlights < ' _ , ' _ , Target , F , G > {
1041- #[ inline( always ) ] fn new_var ( & mut self , offset : usize ) -> ( ) {
1041+ #[ inline] fn new_var ( & mut self , offset : usize ) -> ( ) {
10421042 if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ;
10431043 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 1 . as_bytes ( ) ) ; }
10441044 self . out . write ( ( self . map_variable ) ( self . n , true ) . as_bytes ( ) ) ;
10451045 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 2 . as_bytes ( ) ) ; self . targets = & self . targets [ 1 ..] ; }
10461046 self . n += 1 ;
10471047 }
1048- #[ inline( always ) ] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) {
1048+ #[ inline] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) {
10491049 if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ;
10501050 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 1 . as_bytes ( ) ) ; }
10511051 self . out . write ( ( self . map_variable ) ( i, false ) . as_bytes ( ) ) ;
10521052 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 2 . as_bytes ( ) ) ; self . targets = & self . targets [ 1 ..] ; }
10531053 }
1054- #[ inline( always ) ] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) {
1054+ #[ inline] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) {
10551055 if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ;
10561056 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 1 . as_bytes ( ) ) ; }
10571057 self . out . write ( ( self . map_symbol ) ( s) . as_bytes ( ) ) ;
10581058 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 2 . as_bytes ( ) ) ; self . targets = & self . targets [ 1 ..] ; }
10591059 }
1060- #[ inline( always ) ] fn zero ( & mut self , offset : usize , a : u8 ) -> Option < & ' static str > {
1060+ #[ inline] fn zero ( & mut self , offset : usize , a : u8 ) -> Option < & ' static str > {
10611061 if self . transient { self . out . write ( " " . as_bytes ( ) ) ; } ;
10621062 if offset == self . targets [ 0 ] . 0 { self . out . write ( self . targets [ 0 ] . 1 . as_bytes ( ) ) ; }
10631063 self . out . write ( "(" . as_bytes ( ) ) ; self . transient = false ;
10641064 if offset == self . targets [ 0 ] . 0 { let r = Some ( self . targets [ 0 ] . 2 ) ; self . targets = & self . targets [ 1 ..] ; r }
10651065 else { None }
10661066 }
1067- #[ inline( always ) ] fn add ( & mut self , offset : usize , acc : Option < & ' static str > , sub : ( ) ) -> Option < & ' static str > {
1067+ #[ inline] fn add ( & mut self , offset : usize , acc : Option < & ' static str > , sub : ( ) ) -> Option < & ' static str > {
10681068 self . transient = true ;
10691069 acc
10701070 }
1071- #[ inline( always ) ] fn finalize ( & mut self , offset : usize , acc : Option < & ' static str > ) -> ( ) {
1071+ #[ inline] fn finalize ( & mut self , offset : usize , acc : Option < & ' static str > ) -> ( ) {
10721072 self . out . write ( ")" . as_bytes ( ) ) ;
10731073 if let Some ( end) = acc { self . out . write ( end. as_bytes ( ) ) ; }
10741074 }
@@ -1122,7 +1122,7 @@ impl ExprZipper {
11221122 }
11231123 }
11241124
1125- #[ inline( always ) ]
1125+ #[ inline]
11261126 pub fn write_symbol ( & mut self , value : & [ u8 ] ) -> bool {
11271127 unsafe {
11281128 let l = value. len ( ) ;
@@ -1599,12 +1599,12 @@ impl std::hash::Hash for ExprEnv {
15991599
16001600pub struct TraverseSide { ee : ExprEnv }
16011601impl Traversal < ( ) , ( ) > for TraverseSide {
1602- #[ inline( always ) ] fn new_var ( & mut self , offset : usize ) -> ( ) { self . ee . v += 1 ; }
1603- #[ inline( always ) ] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { }
1604- #[ inline( always ) ] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { }
1605- #[ inline( always ) ] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { }
1606- #[ inline( always ) ] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { }
1607- #[ inline( always ) ] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { }
1602+ #[ inline] fn new_var ( & mut self , offset : usize ) -> ( ) { self . ee . v += 1 ; }
1603+ #[ inline] fn var_ref ( & mut self , offset : usize , i : u8 ) -> ( ) { }
1604+ #[ inline] fn symbol ( & mut self , offset : usize , s : & [ u8 ] ) -> ( ) { }
1605+ #[ inline] fn zero ( & mut self , offset : usize , a : u8 ) -> ( ) { }
1606+ #[ inline] fn add ( & mut self , offset : usize , acc : ( ) , sub : ( ) ) -> ( ) { }
1607+ #[ inline] fn finalize ( & mut self , offset : usize , acc : ( ) ) -> ( ) { }
16081608}
16091609
16101610impl ExprEnv {
0 commit comments