summaryrefslogtreecommitdiff
path: root/parsing/g_constr.ml4
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/g_constr.ml4')
-rw-r--r--parsing/g_constr.ml422
1 files changed, 14 insertions, 8 deletions
diff --git a/parsing/g_constr.ml4 b/parsing/g_constr.ml4
index 9163f3c1..1cde66e2 100644
--- a/parsing/g_constr.ml4
+++ b/parsing/g_constr.ml4
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: g_constr.ml4 9562 2007-01-31 09:00:36Z msozeau $ *)
+(* $Id: g_constr.ml4 9976 2007-07-12 11:58:30Z msozeau $ *)
open Pcoq
open Constr
@@ -21,14 +21,14 @@ open Util
let constr_kw =
[ "forall"; "fun"; "match"; "fix"; "cofix"; "with"; "in"; "for";
- "end"; "as"; "let"; "if"; "then"; "else"; "return";
+ "end"; "as"; "let"; "dest"; "if"; "then"; "else"; "return";
"Prop"; "Set"; "Type"; ".("; "_"; ".." ]
let _ = List.iter (fun s -> Lexer.add_token("",s)) constr_kw
let mk_cast = function
(c,(_,None)) -> c
- | (c,(_,Some ty)) -> CCast(join_loc (constr_loc c) (constr_loc ty), c, CastConv DEFAULTcast, ty)
+ | (c,(_,Some ty)) -> CCast(join_loc (constr_loc c) (constr_loc ty), c, CastConv (DEFAULTcast, ty))
let mk_lam = function
([],c) -> c
@@ -156,13 +156,15 @@ GEXTEND Gram
[ c = binder_constr -> c ]
| "100" RIGHTA
[ c1 = operconstr; "<:"; c2 = binder_constr ->
- CCast(loc,c1, CastConv VMcast,c2)
+ CCast(loc,c1, CastConv (VMcast,c2))
| c1 = operconstr; "<:"; c2 = SELF ->
- CCast(loc,c1, CastConv VMcast,c2)
+ CCast(loc,c1, CastConv (VMcast,c2))
| c1 = operconstr; ":";c2 = binder_constr ->
- CCast(loc,c1, CastConv DEFAULTcast,c2)
+ CCast(loc,c1, CastConv (DEFAULTcast,c2))
| c1 = operconstr; ":"; c2 = SELF ->
- CCast(loc,c1, CastConv DEFAULTcast,c2) ]
+ CCast(loc,c1, CastConv (DEFAULTcast,c2))
+ | c1 = operconstr; ":>" ->
+ CCast(loc,c1, CastCoerce) ]
| "99" RIGHTA [ ]
| "90" RIGHTA
[ c1 = operconstr; "->"; c2 = binder_constr -> CArrow(loc,c1,c2)
@@ -210,6 +212,10 @@ GEXTEND Gram
":="; c1 = operconstr LEVEL "200"; "in";
c2 = operconstr LEVEL "200" ->
CLetTuple (loc,List.map snd lb,po,c1,c2)
+ | "dest"; c1 = operconstr LEVEL "200"; "as"; p=pattern;
+ "in"; c2 = operconstr LEVEL "200" ->
+ CCases (loc, None, [(c1, (None, None))],
+ [loc, [[p]], c2])
| "if"; c=operconstr LEVEL "200"; po = return_type;
"then"; b1=operconstr LEVEL "200";
"else"; b2=operconstr LEVEL "200" ->
@@ -328,7 +334,7 @@ GEXTEND Gram
| "("; id=name; ":="; c=lconstr; ")" ->
LocalRawDef (id,c)
| "("; id=name; ":"; t=lconstr; ":="; c=lconstr; ")" ->
- LocalRawDef (id,CCast (join_loc (constr_loc t) loc,c, CastConv DEFAULTcast,t))
+ LocalRawDef (id,CCast (join_loc (constr_loc t) loc,c, CastConv (DEFAULTcast,t)))
] ]
;
binder: