]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/content/notationEnv.ml
Most warnings turned into errors and avoided
[helm.git] / matita / components / content / notationEnv.ml
index e95b3ab51d8c29729840ebbf9a5b5702d9252e63..164fec0e87e52c90b43cd9ea6291f8e686c0033a 100644 (file)
 
 module Ast = NotationPt
 
+type ident_or_var =
+   Ident of string
+ | Var of string
+
 type value =
   | TermValue of Ast.term
-  | StringValue of string
+  | StringValue of ident_or_var
   | NumValue of string
   | OptValue of value option
   | ListValue of value list
@@ -89,7 +93,7 @@ let lookup_list env name =
   | ty, _ -> raise (Type_mismatch (name, ty))
 
 let opt_binding_some (n, (ty, v)) = (n, (OptType ty, OptValue (Some v)))
-let opt_binding_none (n, (ty, v)) = (n, (OptType ty, OptValue None))
+let opt_binding_none (n, (ty, _v)) = (n, (OptType ty, OptValue None))
 let opt_binding_of_name (n, ty) = (n, (OptType ty, OptValue None))
 let list_binding_of_name (n, ty) = (n, (ListType ty, ListValue []))
 let opt_declaration (n, ty) = (n, OptType ty)
@@ -103,12 +107,12 @@ let declaration_of_var = function
 
 let value_of_term = function
   | Ast.Num (s, _) -> NumValue s
-  | Ast.Ident (s, None) -> StringValue s
+  | Ast.Ident (s, None) -> StringValue (Var s)
   | t -> TermValue t
 
 let term_of_value = function
   | NumValue s -> Ast.Num (s, 0)
-  | StringValue s -> Ast.Ident (s, None)
+  | StringValue (Ident s) -> Ast.Ident (s, None)
   | TermValue t -> t
   | _ -> assert false (* TO BE UNDERSTOOD *)