Skip to content

Commit

Permalink
Remove special lowering of ' in *, /, and \ expressions to A[c]_(mul|…
Browse files Browse the repository at this point in the history
…ldiv|rdiv)_B[c].
  • Loading branch information
Sacha0 committed Dec 19, 2017
1 parent 664fc98 commit 6e3c1ce
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1515,22 +1515,6 @@
(kwcall-unless-empty f pa kw-container kw-container)
`(call (call (core kwfunc) ,f) ,kw-container ,f ,@pa)))))

;; convert e.g. A'*B to Ac_mul_B(A,B)
(define (expand-transposed-op e ops)
(let ((a (caddr e))
(b (cadddr e)))
(cond ((ctrans? a)
(if (ctrans? b)
`(call ,(aref ops 0) #;Ac_mul_Bc ,(expand-forms (cadr a))
,(expand-forms (cadr b)))
`(call ,(aref ops 1) #;Ac_mul_B ,(expand-forms (cadr a))
,(expand-forms b))))
((ctrans? b)
`(call ,(aref ops 2) #;A_mul_Bc ,(expand-forms a)
,(expand-forms (cadr b))))
(else
`(call ,(cadr e) ,(expand-forms a) ,(expand-forms b))))))

;; convert `a+=b` to `a=a+b`
(define (expand-update-operator- op op= lhs rhs declT)
(let ((e (remove-argument-side-effects lhs)))
Expand Down Expand Up @@ -2212,19 +2196,6 @@
((and (eq? f '^) (length= e 4) (integer? (cadddr e)))
(expand-forms
`(call (top literal_pow) ^ ,(caddr e) (call (call (core apply_type) (top Val) ,(cadddr e))))))

((and (eq? f '*) (length= e 4))
(expand-transposed-op
e
#(Ac_mul_Bc Ac_mul_B A_mul_Bc)))
((and (eq? f '/) (length= e 4))
(expand-transposed-op
e
#(Ac_rdiv_Bc Ac_rdiv_B A_rdiv_Bc)))
((and (eq? f '\\) (length= e 4))
(expand-transposed-op
e
#(Ac_ldiv_Bc Ac_ldiv_B A_ldiv_Bc)))
(else
(map expand-forms e))))
(map expand-forms e)))
Expand Down

0 comments on commit 6e3c1ce

Please sign in to comment.