term:
[ "arrow" RIGHTA
[ t1 = term; SYMBOL <:unicode<to>>; t2 = term ->
- return_term loc (CicTextualParser2Ast.Binder (`Pi, Cic.Anonymous, Some t1, t2))
+ return_term loc
+ (CicTextualParser2Ast.Binder (`Pi, Cic.Anonymous, Some t1, t2))
]
| "eq" LEFTA
[ t1 = term; SYMBOL "="; t2 = term ->
| "inv" NONA [ (* nothing here by default *) ]
| "simple" NONA
[
- (* TODO handle "_" *)
b = binder; vars = LIST1 IDENT SEP SYMBOL ",";
typ = OPT [ SYMBOL ":"; t = term -> t ];
SYMBOL "."; body = term ->
let binder =
List.fold_right
- (fun var body -> CicTextualParser2Ast.Binder (b, Cic.Name var, typ, body))
+ (fun var body ->
+ let name =
+ match var with
+ | "_" -> Cic.Anonymous
+ | var -> Cic.Name var
+ in
+ CicTextualParser2Ast.Binder (b, name, typ, body))
vars body
in
return_term loc binder
| LPAREN "("; head = term; args = LIST1 term; RPAREN ")" ->
return_term loc (CicTextualParser2Ast.Appl (head :: args))
| i = NUM -> return_term loc (CicTextualParser2Ast.Num (i, 0))
-(* | i = NUM -> return_term loc (CicTextualParser2Ast.Num (i, Random.int max_int)) *)
| m = META;
substs = [
LPAREN "["; substs = LIST0 meta_subst SEP SYMBOL ";" ; RPAREN "]" ->