projects
/
tatoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
38cbd62
)
Fix descendant-or-self (which wrongly looked for elements in the
author
Kim Nguyễn
<kn@lri.fr>
Sun, 10 Mar 2013 11:33:36 +0000
(12:33 +0100)
committer
Kim Nguyễn
<kn@lri.fr>
Sun, 10 Mar 2013 11:33:36 +0000
(12:33 +0100)
right sibling of self)
src/xpath/compile.ml
patch
|
blob
|
history
diff --git
a/src/xpath/compile.ml
b/src/xpath/compile.ml
index
1c46b8f
..
7848b84
100644
(file)
--- a/
src/xpath/compile.ml
+++ b/
src/xpath/compile.ml
@@
-14,7
+14,7
@@
(***********************************************************************)
(*
(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-03-
09 19:17:26
CET by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-03-
10 12:28:07
CET by Kim Nguyen>
*)
open Ast
*)
open Ast
@@
-70,12
+70,20
@@
let compile_axis_test ?(block_attr=true) axis test phi trans states =
QNameSet.any => F.next_sibling q ]) :: trans,
states)
QNameSet.any => F.next_sibling q ]) :: trans,
states)
- | Descendant
self
->
- (
(if self then F.stay q else F.first_child q)
,
+ | Descendant
false
->
+ (
F.first_child q
,
(q, [ test => phi %% phi_attr;
QNameSet.any => F.first_child q ++ F.next_sibling q;
]) :: trans,
states)
(q, [ test => phi %% phi_attr;
QNameSet.any => F.first_child q ++ F.next_sibling q;
]) :: trans,
states)
+ | Descendant true ->
+ let q' = State.make () in
+ (F.or_ (F.stay q) (F.first_child q'),
+ (q', [ test => phi %% phi_attr;
+ QNameSet.any => F.first_child q' ++ F.next_sibling q';
+ ])::
+ (q, [ test => phi %% phi_attr]):: trans,
+ states)
| Parent ->
let q' = State.make () in
| Parent ->
let q' = State.make () in