소스 검색

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