Skip to content

Commit 61226f9

Browse files
committed
the default is now MAX priority
We are going to start enforcing the invariant that an expression with priority N can only directly things of higher priority. In that case for something like this: ``` enum Expr { Id(Id), Literal(Literal), #[precedence(1, left)] Add(Expr, Expr), #[precedence(2, left)] Mul(Expr, Expr), } ``` you want Id/Literal to be max priority so they can be embedded into anything.
1 parent 2b49e23 commit 61226f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/formality-core/src/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl Precedence {
107107

108108
impl Default for Precedence {
109109
fn default() -> Self {
110-
Self::new(0, Associativity::None)
110+
Self::new(std::usize::MAX, Associativity::None)
111111
}
112112
}
113113

0 commit comments

Comments
 (0)