浏览代码

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