XPath compiler support for the self axis
This commit is contained in:
parent
bc49af02a2
commit
02ee35122a
lib/oga/xpath
|
@ -257,6 +257,17 @@ module Oga
|
|||
end
|
||||
end
|
||||
|
||||
# @param [AST::Node] ast
|
||||
# @param [Oga::Ruby::Node] input
|
||||
# @return [Oga::Ruby::Node]
|
||||
def on_axis_self(ast, input, &block)
|
||||
node = node_literal
|
||||
|
||||
backup_variable(node, input) do
|
||||
process(ast, node, &block).if_true { yield node }
|
||||
end
|
||||
end
|
||||
|
||||
# @param [AST::Node] ast
|
||||
# @param [Oga::Ruby::Node] input
|
||||
# @return [Oga::Ruby::Node]
|
||||
|
|
Loading…
Reference in New Issue