Skip to content

Arithmetic operator precedence #10

@emiln

Description

@emiln

No effort has been invested in ensuring that expressions like

2 + 3 * 4

actually parse to

[:addition
 [:constant "2"]
 [:multiplication [:constant "3"] [:constant "4"]]]

rather than

[:addition
 [:multiplication [:constant "2"] [:constant "3"]]
 [:constant "4"]]

and I would be surprised if the parser actually works as you'd expect.

Solving this is probably not very hard.

This clearly also calls for a new suite of tests, and these will have to be more closely related to the actual AST.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions