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
15 lines
386 B
Text
15 lines
386 B
Text
open expr tactic
|
|
|
|
example : true := by whnf (var 0) >> return ()
|
|
|
|
example : true := by whnf (app (var 0) (var 0)) >> return ()
|
|
|
|
example : true := by head_zeta (var 0) >> return ()
|
|
|
|
example : true := by unify (var 0) (var 0) >> return ()
|
|
|
|
example : true := by is_def_eq (var 0) (var 0) >> return ()
|
|
|
|
example (foo trivial) := by do
|
|
t ← infer_type (var 0),
|
|
to_expr ``(trivial) >>= apply
|