Rewrite parser using ocamlyacc to remove further dependencies
[tatoo.git] / src / xPath.ml
index 0e71caf..aab6422 100644 (file)
@@ -21,7 +21,7 @@ struct
   and axis = Self | Attribute | Child | Descendant | DescendantOrSelf | FollowingSibling
              | Parent | Ancestor | AncestorOrSelf | PrecedingSibling | Preceding | Following
 
-  and test = Simple of QNameSet.t
+  and test = QNameSet.t
 
   and binop = Eq | Neq | Lt | Gt | Lte | Gte | Or | And | Add | Sub | Mult | Div | Mod
   and unop =  Neg
@@ -45,9 +45,6 @@ struct
                          QName.document;
                          QName.cdata_section;
                          QName.comment])
-  let t_text = Simple text
-  let t_node = Simple node
-  let t_star = Simple star
 
 
 
@@ -122,15 +119,14 @@ struct
   and print_test fmt ts =
     try
       pp fmt "%s" (List.assoc ts
-                     [ t_text,"text()";
-                       t_node,"node()";
-                       t_star, "*" ] )
+                     [ text,"text()";
+                       node,"node()";
+                       star, "*" ] )
     with
       Not_found -> pp fmt "%s"
-        (match ts with
-          Simple t -> if QNameSet.is_finite t
-            then QName.to_string (QNameSet.choose t)
-            else "<INFINITE>"
+        (if QNameSet.is_finite ts
+         then QName.to_string (QNameSet.choose ts)
+         else "<INFINITE>"
         )
 
   and print_expr fmt = function