Преглед на файлове

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 преди 7 месеца
родител
ревизия
6d732299ca
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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