Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Conversation

ryangjchandler
Copy link
Contributor

@ryangjchandler ryangjchandler commented Sep 12, 2022

The existing precedence parsing using binding powers is getting quite confusing. Since PHP provides a nice list of operator precedences already, it makes sense to use that same scale ourselves in the parser.

The goal will be:

  • Mapping all operators to a Precedence and Associativity
  • Get all existing tests to pass

Once that's done, it should be incredibly simple to get new operators added in.

@ryangjchandler ryangjchandler force-pushed the refactor/operator-precedence branch from 80f14ed to f1b82a5 Compare September 13, 2022 00:05
@ryangjchandler ryangjchandler force-pushed the refactor/operator-precedence branch from f1b82a5 to 5874fc5 Compare September 13, 2022 13:10
@ryangjchandler
Copy link
Contributor Author

So the code has been updated to use the new Precedence enumeration. I've not actually put the Associativity one in yet.

Some of the tests are failing presumably because of the missing associativity rules.

@ryangjchandler ryangjchandler marked this pull request as ready for review September 14, 2022 11:01
@ryangjchandler ryangjchandler merged commit 53921a1 into main Sep 14, 2022
@ryangjchandler ryangjchandler deleted the refactor/operator-precedence branch September 14, 2022 11:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

1 participant