Now, the following example produces a syntax error. ```lean macro "foo!" x:term : term => `($x + 1) check id foo! 10 ``` @Kha, I think the heuristic is simple and defensible. If the new syntax starts and ends with token, than the precedence is `maxPrec`. Otherwise, it is `leadPrec`. see #180
24 lines
899 B
Text
24 lines
899 B
Text
id fun (x : ?m) => x : ?m → ?m
|
|
0 : Nat
|
|
f 1 fun (x : Nat) => x : Nat
|
|
0 : Nat
|
|
f 1 fun (x : Nat) => x : Nat
|
|
id : ?m → ?m
|
|
precissues.lean:15:10: error: expected command, but found term; this error may be due to parsing precedence levels, consider parenthesizing the term
|
|
id : ?m → ?m
|
|
precissues.lean:17:10: error: expected command, but found term; this error may be due to parsing precedence levels, consider parenthesizing the term
|
|
1 : Nat
|
|
id ((fun (this : True) => this) True.intro) : True
|
|
0 = (fun (this : Nat) => this) 1 : Prop
|
|
0 = let x : Nat := 0; x : Prop
|
|
p ↔ ¬q : Prop
|
|
True = ¬False : Prop
|
|
p ∧ ¬q : Prop
|
|
¬p ∧ q : Prop
|
|
¬p ↔ q : Prop
|
|
¬p = q : Prop
|
|
¬p = q : Prop
|
|
id ¬p : Prop
|
|
(a a_1 : Nat) → a_1 = a_1 : Prop
|
|
id : ?m → ?m
|
|
precissues.lean:41:10: error: expected command, but found term; this error may be due to parsing precedence levels, consider parenthesizing the term
|