@@ -751,11 +751,37 @@ mod scalars {
751751                let  x = sub_eval ( x,  ctx) ; 
752752                field:: mul ( x,  y,  ctx. w ) 
753753            } 
754-             Operations :: Sub ( _,  _)  => todo ! ( ) , 
755-             Operations :: Double ( _)  => todo ! ( ) , 
756-             Operations :: Square ( _)  => todo ! ( ) , 
757-             Operations :: Cache ( _,  _)  => todo ! ( ) , 
758-             Operations :: IfFeature ( _,  _,  _)  => todo ! ( ) , 
754+             Operations :: Sub ( x,  y)  => { 
755+                 let  x = sub_eval ( x,  ctx) ; 
756+                 let  y = sub_eval ( y,  ctx) ; 
757+                 x - y
758+             } 
759+             Operations :: Double ( x)  => { 
760+                 let  x = sub_eval ( x,  ctx) ; 
761+                 x. double ( ) 
762+             } 
763+             Operations :: Square ( x)  => { 
764+                 let  x = sub_eval ( x,  ctx) ; 
765+                 field:: mul ( x,  x,  ctx. w ) 
766+             } 
767+             Operations :: Cache ( id,  _e)  => ctx. cache . get ( id) . copied ( ) . unwrap ( ) , 
768+             Operations :: IfFeature ( feature,  e1,  e2)  => match  ctx. env . feature_flags . as_ref ( )  { 
769+                 None  => sub_eval ( e2,  ctx) , 
770+                 Some ( feature_flags)  => { 
771+                     let  is_feature_enabled = match  get_feature_flag ( feature_flags,  feature,  ctx. w )  { 
772+                         None  => return  sub_eval ( e2,  ctx) , 
773+                         Some ( enabled)  => enabled, 
774+                     } ; 
775+ 
776+                     let  on_false = sub_eval ( e2,  ctx) ; 
777+                     let  on_true = sub_eval ( e1,  ctx) ; 
778+ 
779+                     ctx. w . exists_no_check ( match  is_feature_enabled { 
780+                         Boolean :: True  => on_true, 
781+                         Boolean :: False  => on_false, 
782+                     } ) 
783+                 } 
784+             } , 
759785        } 
760786    } 
761787
0 commit comments