Remove AbsoluteDOS from the XPath AST.
[tatoo.git] / src / xPath.ml
index 7ebc135..5258b67 100644 (file)
@@ -17,7 +17,7 @@
 module Ast =
 struct
 
-  type path = Absolute of step list | AbsoluteDoS of step list| Relative of step list
+  type path = Absolute of step list | Relative of step list
   and step = axis * test *predicate
   and axis = Self | Attribute | Child | Descendant | DescendantOrSelf | FollowingSibling
              | Parent | Ancestor | AncestorOrSelf | PrecedingSibling | Preceding | Following
@@ -62,9 +62,6 @@ struct
   let rec print fmt p =
     let l = match p with
       | Absolute l -> pp fmt "/"; l
-      | AbsoluteDoS l -> pp fmt "/";
-        print_step fmt (DescendantOrSelf,Simple QNameSet.any,Expr True);
-        pp fmt "/"; l
       | Relative l -> l
     in
       Pretty.print_list ~sep:"/" print_step fmt l
@@ -139,8 +136,6 @@ struct
     print_axis r a; Format.flush_str_formatter()
 
 
-
-
 EXTEND Gram
 
 GLOBAL: query;
@@ -149,8 +144,7 @@ GLOBAL: query;
 ;
 
  path : [
-   [ "//" ; l = slist -> AbsoluteDoS (List.rev l) ]
- | [ "/" ; l = slist -> Absolute (List.rev l) ]
+ [ "/" ; l = slist -> Absolute (List.rev l) ]
  | [ l = slist  -> Relative (List.rev l) ]
  ]
 ;
@@ -174,8 +168,8 @@ step : [
       | Some(t) ->  (axis,t,p)
       | None -> (Child,Simple (QNameSet.singleton (QName.of_string (axis_to_string axis))),p)
     in match a with
-      | Following -> [ (DescendantOrSelf,t,p);
-               (FollowingSibling, t_star,Expr(True));
+      | Following -> [ (DescendantOrSelf,t,p); 
+              (FollowingSibling, t_star,Expr(True));
                (Ancestor, t_star ,Expr(True)) ]
 
       | Preceding -> [ (DescendantOrSelf,t,p);