XPath compiler support for the self axis

This commit is contained in:
Yorick Peterse 2015-08-03 09:43:31 +02:00
parent bc49af02a2
commit 02ee35122a
1 changed files with 11 additions and 0 deletions
lib/oga/xpath

View File

@ -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]