XPath compiler support for "descendant"

This commit is contained in:
Yorick Peterse 2015-08-03 09:29:32 +02:00
parent f8671a96b7
commit ca7930cbf4
1 changed files with 13 additions and 0 deletions

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]