Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix implicit multiplication priority #323

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

probablykasper
Copy link
Contributor

@probablykasper probablykasper commented Oct 25, 2024

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
Contributor Author

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

Also, what is Expr::Bop?

@printfn
Copy link
Owner

printfn commented Oct 27, 2024

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.

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