XPath compiler support for "descendant"

This commit is contained in:
Yorick Peterse committed 2015-08-19 20:14:22 +02:00
1 parent f8671a96b7
commit ca7930cbf4
1 file changed
+13
+13
View File
@@ -231,6 +231,19 @@ module Oga
end
end
# @param [AST::Node] ast
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node]
def on_axis_descendant(ast, input, &block)
node = node_literal
backup_variable(node, input) do
node.each_node.add_block(node) do
process(ast, node, &block).if_true { yield node }
end
end
end
# @param [AST::Node] ast
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node]