XPath compiler support for the parent axis
This commit is contained in:
parent
ca7930cbf4
commit
bc49af02a2
|
@ -244,6 +244,19 @@ module Oga
|
|||
end
|
||||
end
|
||||
|
||||
# @param [AST::Node] ast
|
||||
# @param [Oga::Ruby::Node] input
|
||||
# @return [Oga::Ruby::Node]
|
||||
def on_axis_parent(ast, input, &block)
|
||||
node = node_literal
|
||||
|
||||
input.is_a?(XML::Node).if_true do
|
||||
backup_variable(node, input.parent) 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]
|
||||
|
|
Loading…
Reference in New Issue