Safety before Techfest
[SXSI/xpathcomp.git] / xPath.ml
index bef0336..2ac43b7 100644 (file)
--- a/xPath.ml
+++ b/xPath.ml
@@ -153,10 +153,16 @@ step : [
 | [ "." ; p = top_pred ->  [(Self,TagSet.node,p)]  ]
 | [ ".." ; p = top_pred ->  [(Parent,TagSet.star,p)]  ]
 | [ "contains"; "(" ; s = STRING ; ")";p=top_pred -> [ 
-      let _ = contains := Some(s) in  (Child,TagSet.singleton Tag.pcdata, p)]
+      let _ = contains := Some((`CONTAINS,s)) in  (Child,TagSet.singleton Tag.pcdata, p)]
   ]
-| [ "contains_full"; "(" ; s = STRING ; ")";p=top_pred -> [ 
-      let _ = contains := Some(s) in  (Descendant,TagSet.singleton Tag.pcdata, p)]
+| [ "equals"; "(" ; s = STRING ; ")";p=top_pred -> [ 
+      let _ = contains := Some((`EQUALS,s)) in  (Child,TagSet.singleton Tag.pcdata, p)]
+  ]
+| [ "startswith"; "(" ; s = STRING ; ")";p=top_pred -> [ 
+      let _ = contains := Some((`STARTSWITH,s)) in  (Child,TagSet.singleton Tag.pcdata, p)]
+  ]
+| [ "endswith"; "(" ; s = STRING ; ")";p=top_pred -> [ 
+      let _ = contains := Some((`ENDSWITH,s)) in  (Child,TagSet.singleton Tag.pcdata, p)]
   ]
 | [ test = test; p = top_pred  -> [(Child,test, p)] ]
 | [ att = ATT ; p = top_pred ->