Browse Source

Always implement subtraction as adding a negation when generating an Expr

This removes the need to implement subtraction at the sigma_rs layer
Ian Goldberg 3 months ago
parent
commit
6d732299ca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      sigma_compiler_core/src/sigma/types.rs

+ 1 - 1
sigma_compiler_core/src/sigma/types.rs

@@ -681,7 +681,7 @@ impl<'a> AExprFold<TokenStream> for AExprTokenFold<'a> {
     ) -> Result<TokenStream> {
         let le = larg.1;
         let re = rarg.1;
-        Ok(quote! { #le - #re })
+        Ok(quote! { #le + (-#re) })
     }
 
     /// Called when subtracting two `Point`s