Use "node" for axis variables

This ensures that any nested code uses the right variables.
This commit is contained in:
Yorick Peterse 2015-07-29 22:05:53 +02:00
parent 045cfe4ab8
commit d50f89cdf1
1 changed files with 2 additions and 3 deletions

View File

@ -193,8 +193,7 @@ module Oga
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node]
def on_axis_ancestor_or_self(ast, input, &block)
parent = literal('parent')
parent = node_literal
self_test = process(ast, input, &block).if_true { yield input }
ancestors_test = input.each_ancestor.add_block(parent) do
@ -208,7 +207,7 @@ module Oga
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node]
def on_axis_ancestor(ast, input, &block)
parent = literal('parent')
parent = node_literal
input.each_ancestor.add_block(parent) do
process(ast, parent, &block).if_true { yield parent }