3
1
Prechádzať zdrojové kódy

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 mesiacov pred
rodič
commit
6d732299ca
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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