fend icon indicating copy to clipboard operation
fend copied to clipboard

Fix implicit multiplication priority

Open probablykasper opened this issue 1 year ago • 2 comments

This results in 1m / 1m being parsed as (1m)/(1m) instead of ((1m)/1)m which is a step towards what I wrote in https://github.com/printfn/fend/issues/76#issuecomment-2433861675.

Notes/todo:

  • Tests are failing because for example 1 kg somehow gets turned into number 1000/1000 k-g (= 1000/1000 kilogram^-1) (base 10, auto, simplifiable)
  • There are probably more parse_power() calls that should be replaced by parse_implicit_multiplication()
  • 1 % 1m is no longer possible with this. In my opinion that's good, but you may disagree

probablykasper avatar Oct 25 '24 22:10 probablykasper

Any thoughts/feedback/tips @printfn? Do you agree that this change make sense?

Also, what is Expr::Bop?

probablykasper avatar Oct 27 '24 07:10 probablykasper

I haven't had a change to look at the code yet, but in theory this seems like a good change, assuming we can get it to work without too many breakages 😅

Bop is for binary operation/operator.

printfn avatar Oct 27 '24 07:10 printfn

@printfn Wanna have a look at the code? I'm not really sure how to go forward

probablykasper avatar Feb 12 '25 21:02 probablykasper