Revamp descendant-or-self compiler specs

This commit is contained in:
Yorick Peterse committed 2015-08-27 10:34:25 +02:00
1 parent 8f341b40d6
commit d5aad9c1c9
2 files changed
+103 -80

No files matched your search

+9 -7
View File
@@ -204,15 +204,17 @@ module Oga
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node]
def on_axis_descendant_or_self(ast, input)
node = node_literal
node = unique_literal(:descendant)
process(ast, input)
.if_true { yield input }
.followed_by do
input.each_node.add_block(node) do
process(ast, node).if_true { yield node }
document_or_node(input).if_true do
process(ast, input)
.if_true { yield input }
.followed_by do
input.each_node.add_block(node) do
process(ast, node).if_true { yield node }
end
end
end
end
end
# @param [AST::Node] ast