Comment from parser.h
This commit makes sure that all declaration parameters must be surrounded with some kind of bracket. (e.g., '()', '{}', '[]').
The goal is to avoid counter-intuitive declarations such as:
example p : false := trivial
def main proof : false := trivial
which would be parsed as
example (p : false) : _ := trivial
def main (proof : false) : _ := trivial
where `_` in both cases is elaborated into `true`. This issue was raised by @gebner in the slack channel.
Remark: we still want implicit delimiters for lambda/pi expressions. That is, we want to write
fun x : t, s
or
fun x, s
instead of
fun (x : t), s
20 lines
502 B
Text
20 lines
502 B
Text
--
|
|
definition foo1 (a b c) := a + b + (c:nat)
|
|
|
|
definition foo2 (a : nat) (b c) := a + b + c
|
|
|
|
definition foo3 (a b) (c : nat) := a + b + c
|
|
|
|
definition foo4 (a b c : nat) := a + b + c
|
|
|
|
definition foo5 (a b c) : nat := a + b + c
|
|
|
|
definition foo6 {a b c} : nat := a + b + c
|
|
|
|
-- definition foo7 a b c : nat := a + b + c -- Error
|
|
|
|
definition foo8 (a b c : nat) : nat := a + b + c
|
|
|
|
definition foo9 (a : nat) (b : nat) (c : nat) : nat := a + b + c
|
|
|
|
definition foo10 (a : nat) (b) (c : nat) : nat := a + b + c
|