Skip to content

Fix implicit multiplication priority#323

Draft
probablykasper wants to merge 6 commits into
printfn:mainfrom
probablykasper:implicit-mult-fix
Draft

Fix implicit multiplication priority#323
probablykasper wants to merge 6 commits into
printfn:mainfrom
probablykasper:implicit-mult-fix

Conversation

@probablykasper

@probablykasper probablykasper commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

This results in 1m / 1m being parsed as (1m)/(1m) instead of ((1m)/1)m which is a step towards what I wrote in #76 (comment).

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 probablykasper marked this pull request as draft October 25, 2024 23:35
@probablykasper

Copy link
Copy Markdown
Contributor Author

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

Also, what is Expr::Bop?

@printfn

printfn commented Oct 27, 2024

Copy link
Copy Markdown
Owner

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.

@probablykasper

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants