rust-peg icon indicating copy to clipboard operation
rust-peg copied to clipboard

Implement no associative infix op for precedence!{}

Open A4-Tacks opened this issue 5 months ago • 2 comments

Like a:@ "<" b:@ {}

Part of #404

A4-Tacks avatar Aug 08 '25 06:08 A4-Tacks

Rebased this and tweaked the test to use "<" and ">" as the example non-associative operators rather than "+" to demonstrate an example use case.

But I found a problem with it: I added a left-associative "||" that binds weaker than "<" and ">" but this doesn't work correctly -- it should be allowed to have an associative operator with non-associative arguments, but the new boolean result propagates up and prevents that operator from being parsed.

kevinmehall avatar Nov 02 '25 20:11 kevinmehall

I have implemented a tests passed parser

But I suspect it has more hidden problems, and it's a bit unsightly

(The println!() used for debugging has not been removed)

A4-Tacks avatar Nov 03 '25 08:11 A4-Tacks