Skip to content

Implement associativity attributes #6

@osa1

Description

@osa1

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:

#[assoc(left)]
<e1:Expr> "+" <e2:Expr> => ...

#[assoc(right)]
<e1:Expr> "?" <e2:Expr> ":" <e3:Expr> => ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions