X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fxpath%2Fcompile.ml;h=20f06bec73480a9f74aa9e2e569b57c45d7af524;hp=e8ab6fc47609151c9741f7dac336052cc83341ee;hb=4f265eb7d78b740292b5543d94f9f0fa40d206d5;hpb=31d45495fda9a110fd348f8b492761c28b434ec9 diff --git a/src/xpath/compile.ml b/src/xpath/compile.ml index e8ab6fc..20f06be 100644 --- a/src/xpath/compile.ml +++ b/src/xpath/compile.ml @@ -40,7 +40,7 @@ let root_set = QNameSet.singleton QName.document *) let compile_axis_test axis (test,kind) phi trans states = - let q = State.make () in + let q = State.next () in let phi = match kind with Tree.NodeKind.Node -> phi | _ -> phi %% F.is kind @@ -65,7 +65,7 @@ let compile_axis_test axis (test,kind) phi trans states = ]) :: trans, states) | Descendant true -> - let q' = State.make () in + let q' = State.next () in (F.stay q ++ F.first_child q', (q', [ QNameSet.any => F.stay q ++ F.first_child q' ++ F.next_sibling q'; ]):: @@ -73,7 +73,7 @@ let compile_axis_test axis (test,kind) phi trans states = states) | Parent -> - let q' = State.make () in + let q' = State.next () in let move = F.parent q ++ F.previous_sibling q' in (move, (q, [ test => phi ]) @@ -81,7 +81,7 @@ let compile_axis_test axis (test,kind) phi trans states = (q' @: states)) | Ancestor self -> - let q' = State.make () in + let q' = State.next () in let move = F.parent q' ++ F.previous_sibling q' in (if self then F.stay q ++ F.stay q' else F.stay q'), (q', [ QNameSet.any => move ++ F.parent q]) @@ -208,7 +208,7 @@ let compile_top_level_step_list l trans states = in loop ll trans2 states2 phi2 in - let starting = State.make () in + let starting = State.next () in let phi0, trans0, states0 = compile_axis_test Self @@ -236,7 +236,7 @@ let path p = let builder = Ata.Builder.make () in (** ensure that we have a single selecting state at the end *) let phi_sel = StateSet.fold (fun q acc -> F.or_ (F.stay q) acc) mstates F.false_ in - let q_sel = State.make () in + let q_sel = State.next () in let states = StateSet.add q_sel states in let mstates = StateSet.singleton q_sel in let trans = (q_sel, [QNameSet.any, phi_sel]) :: trans in