Open osa1 opened 2 years ago
LALRPOP PRs that added precedence and associativity annotations:
We should probably just copy the syntax (and maybe implementation too), but I would prefer avoiding lvl
and side
argument names. Just #[precedence(2)] #[assoc(left)]
should be OK. (Do we need string quotes around 2
and left
? I hope not)
See also:
It's tedious to parse expressions without associativity attributes.
Left associative = reduce in a shift/reduce conflict Right associative = shift in a shift/reduce conflict
I don't like ocamlyacc/menhir/happy style associativity lines before non-terminals/productions. I think we should probably use Rust attribute syntax and annotate productions with the associativity attributes. Examples: