Skip to content

Associativity of multiplication / division #6

Closed

Description

@laurmaedje

The current parser implementation has the problem that the associativity of multiplication and division is reversed. Thus, 3 / 4 * 5 is parsed as 3 / (4 * 5) instead of the correct (3 / 4) * 5. The current approach of parsing the left-hand side of an expression one precendence-level lower and the right-hand side at the same level won't work now since making the left-hand side same level would make the parser left-recursive (infinite recursion). The best approach is probably to parse operands in a loop.

Activity

  1. laurmaedje commented on Jul 27, 2020

    @laurmaedje
    MemberAuthor

    This can be closed once #7 is merged.

  2. added a commit that references this issue on Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions