From 61226f99ccd61b543a491adb328a173c787f53e6 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 7 Nov 2023 10:53:58 -0500 Subject: [PATCH] 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. --- crates/formality-core/src/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/formality-core/src/parse/parser.rs b/crates/formality-core/src/parse/parser.rs index 251241e9..dea85e2f 100644 --- a/crates/formality-core/src/parse/parser.rs +++ b/crates/formality-core/src/parse/parser.rs @@ -107,7 +107,7 @@ impl Precedence { impl Default for Precedence { fn default() -> Self { - Self::new(0, Associativity::None) + Self::new(std::usize::MAX, Associativity::None) } }