Skip to content

Associativity of multiplication / division #6

@laurmaedje

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.

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