diff options
author | 2016-01-11 22:20:16 +0100 | |
---|---|---|
committer | 2016-01-14 18:23:32 +0100 | |
commit | 448866f0ec5291d58677d8fccbefde493ade0ee2 (patch) | |
tree | 2824618cc31f7422be33f537c4ae8a8719180c53 /lib | |
parent | 67b9b34d409c793dc449104525684852353ee064 (diff) |
Removing constr generic argument.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/genarg.ml | 13 | ||||
-rw-r--r-- | lib/genarg.mli | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/lib/genarg.ml b/lib/genarg.ml index af9ea70ec..c2c1014f1 100644 --- a/lib/genarg.ml +++ b/lib/genarg.ml @@ -57,14 +57,12 @@ end type argument_type = (* Specific types *) - | ConstrArgType | ListArgType of argument_type | OptArgType of argument_type | PairArgType of argument_type * argument_type | ExtraArgType of string let rec argument_type_eq arg1 arg2 = match arg1, arg2 with -| ConstrArgType, ConstrArgType -> true | ListArgType arg1, ListArgType arg2 -> argument_type_eq arg1 arg2 | OptArgType arg1, OptArgType arg2 -> argument_type_eq arg1 arg2 | PairArgType (arg1l, arg1r), PairArgType (arg2l, arg2r) -> @@ -73,7 +71,6 @@ let rec argument_type_eq arg1 arg2 = match arg1, arg2 with | _ -> false let rec pr_argument_type = function -| ConstrArgType -> str "constr" | ListArgType t -> pr_argument_type t ++ spc () ++ str "list" | OptArgType t -> pr_argument_type t ++ spc () ++ str "opt" | PairArgType (t1, t2) -> @@ -190,19 +187,12 @@ let default_empty_value t = | _ -> None) | ExtraArgType s -> (String.Map.find s !arg0_map).nil - | _ -> None in + in match aux t with | Some v -> Some (Obj.obj v) | None -> None -(** Beware: keep in sync with the corresponding types *) -let base_create n = Val.Base (Dyn.create n) -let genarg_T = base_create "genarg" -let constr_T = base_create "constr" - let rec val_tag = function - (** Must ensure that toplevel types of Var and Ident agree! *) -| ConstrArgType -> cast_tag constr_T | ExtraArgType s -> cast_tag (String.Map.find s !arg0_map).dyn | ListArgType t -> cast_tag (Val.List (val_tag t)) | OptArgType t -> cast_tag (Val.Opt (val_tag t)) @@ -222,7 +212,6 @@ let try_prj wit v = match prj (val_tag wit) v with let rec val_cast : type a. a typed_abstract_argument_type -> Val.t -> a = fun wit v -> match unquote wit with -| ConstrArgType | ExtraArgType _ -> try_prj wit v | ListArgType t -> let Val.Dyn (tag, v) = v in diff --git a/lib/genarg.mli b/lib/genarg.mli index 8d929f9f6..56c09f14f 100644 --- a/lib/genarg.mli +++ b/lib/genarg.mli @@ -211,8 +211,6 @@ val val_cast : 'a typed_abstract_argument_type -> Val.t -> 'a (** {6 Type reification} *) type argument_type = - (** Basic types *) - | ConstrArgType (** Specific types *) | ListArgType of argument_type | OptArgType of argument_type |