X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2FxPath.ml;h=5258b6778816be5a046d4a1eed0e512486d1f4aa;hp=7ebc13558772d2eaca02d932a78999f142644b66;hb=e2dcfc3066d33b814d4e9724563cc5b3e696060d;hpb=54b9cdaa6686eb28a0cad0ac3f1648f115d3fac5 diff --git a/src/xPath.ml b/src/xPath.ml index 7ebc135..5258b67 100644 --- a/src/xPath.ml +++ b/src/xPath.ml @@ -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);