NOP0 / rustmatic

PLC programming in Rust!
Apache License 2.0
35 stars 2 forks source link

Structured text parser doesn't handle operator precedence #10

Open Michael-F-Bryan opened 4 years ago

Michael-F-Bryan commented 4 years ago

The structured-text parser doesn't know how to handle operator precedence. At the moment, al binary operators will be parsed using infix = { expression_inner ~ (binary_operator ~ expression_inner)+ }.

I'm pretty sure this would be solved by using PrecClimber, but haven't tried it yet. As well as the usual arithmetic precedence rules, we'll need to take things like the dot operator and call syntax into account.

Michael-F-Bryan commented 4 years ago

I'm pretty sure we can copy the precedence parsing code from one of pest's tests.