Removed various unused variables

This commit is contained in:
Yorick Peterse 2015-08-30 01:46:52 +02:00
parent 1b62dd3256
commit 435115c454
1 changed files with 5 additions and 9 deletions

View File

@ -343,9 +343,8 @@ module Oga
# @param [Oga::Ruby::Node] input # @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node] # @return [Oga::Ruby::Node]
def on_axis_preceding(ast, input) def on_axis_preceding(ast, input)
orig_input = original_input_literal root = literal(:root)
root = literal(:root) doc_node = literal(:doc_node)
doc_node = literal(:doc_node)
input.is_a?(XML::Node).if_true do input.is_a?(XML::Node).if_true do
root.assign(input.root_node) root.assign(input.root_node)
@ -524,7 +523,6 @@ module Oga
# @return [Oga::Ruby::Node] # @return [Oga::Ruby::Node]
# #
def on_predicate_index(input, test, predicate) def on_predicate_index(input, test, predicate)
pred_var = unique_literal(:pred_var)
index_var = predicate_index index_var = predicate_index
index_step = literal(1) index_step = literal(1)
@ -643,10 +641,8 @@ module Oga
end end
# @param [AST::Node] ast # @param [AST::Node] ast
# @param [Oga::Ruby::Node] input
# @return [Oga::Ruby::Node] # @return [Oga::Ruby::Node]
def on_var(ast, input) def on_var(ast, *)
vars = variables_literal
name = ast.children[0] name = ast.children[0]
variables_literal.and(variables_literal[string(name)]) variables_literal.and(variables_literal[string(name)])
@ -844,7 +840,7 @@ module Oga
# nodes. # nodes.
if return_nodeset?(arg) if return_nodeset?(arg)
ids_var.assign(literal(:[])).followed_by do ids_var.assign(literal(:[])).followed_by do
process(arg, input) { |node| ids_var << node.text } process(arg, input) { |element| ids_var << element.text }
end end
# For everything else we'll cast the value to a string and split it # For everything else we'll cast the value to a string and split it
@ -1484,7 +1480,7 @@ module Oga
left_ast = try_match_first_node(left, input, optimize_first) left_ast = try_match_first_node(left, input, optimize_first)
right_ast = try_match_first_node(right, input, optimize_first) right_ast = try_match_first_node(right, input, optimize_first)
initial_assign = left_var.assign(left_ast) left_var.assign(left_ast)
.followed_by(right_var.assign(right_ast)) .followed_by(right_var.assign(right_ast))
.followed_by { yield left_var, right_var } .followed_by { yield left_var, right_var }
end end