#include <cstdio>
-#if 0
-#define ASSERT_NODE(orig, res) do { \
- if (res < -1 || res >= par->n|| (res != -1 && res < orig)) \
- fprintf(stderr, \
- "Assertion failure: original node %i, result %i, line %i\n", \
- orig, res, __LINE__); \
- } while (0)
-#else
-#define ASSERT_NODE(orig, res)
-#endif
-
inline uint32_t xml_tree::size() const
{
return tag_seq_len / 2;
inline xml_tree::node_t xml_tree::first_child(node_t x) const
{
xml_tree::node_t result = bp_first_child(this->par, x);
- ASSERT_NODE(x, result);
return result;
}
inline xml_tree::node_t xml_tree::next_sibling(xml_tree::node_t x) const
{
xml_tree::node_t result = bp_next_sibling(this->par, x);
- ASSERT_NODE(x, result);
return result;
}
return c;
else
return tagged_sibling(c, t);
- /* ASSERT_NODE(x, result);
- return result;*/
}
inline xml_tree::node_t xml_tree::tagged_sibling(xml_tree::node_t x,
xml_tree::tag_t stag;
while (sibling != xml_tree::NIL) {
stag = tag(sibling);
- if (stag == t) {
- ASSERT_NODE(x, sibling);
+ if (stag == t)
return sibling;
- }
sibling = next_sibling(sibling);
};
- ASSERT_NODE(x, sibling);
return sibling;
}