Removed useless YARD docs from the XPath compiler
The method names already explain their intent.
This commit is contained in:
parent
20c6bbdaa8
commit
e549b28ca4
|
@ -110,13 +110,9 @@ module Oga
|
||||||
ruby_ast
|
ruby_ast
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes an absolute path.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_absolute_path(ast, input, &block)
|
def on_absolute_path(ast, input, &block)
|
||||||
if ast.children.empty?
|
if ast.children.empty?
|
||||||
matched_literal.push(input.root_node)
|
matched_literal.push(input.root_node)
|
||||||
|
@ -142,13 +138,9 @@ module Oga
|
||||||
send(:"on_axis_#{handler}", test, input, &block)
|
send(:"on_axis_#{handler}", test, input, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes the "child" axis.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_axis_child(ast, input, &block)
|
def on_axis_child(ast, input, &block)
|
||||||
child = node_literal
|
child = node_literal
|
||||||
condition = process(ast, child, &block)
|
condition = process(ast, child, &block)
|
||||||
|
@ -158,13 +150,9 @@ module Oga
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes the "attribute" axis.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_axis_attribute(ast, input)
|
def on_axis_attribute(ast, input)
|
||||||
input.is_a?(XML::Element).if_true do
|
input.is_a?(XML::Element).if_true do
|
||||||
attribute = literal('attribute')
|
attribute = literal('attribute')
|
||||||
|
@ -181,13 +169,9 @@ module Oga
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes the `ancestor-or-self` axis.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_axis_ancestor_or_self(ast, input, &block)
|
def on_axis_ancestor_or_self(ast, input, &block)
|
||||||
parent = literal('parent')
|
parent = literal('parent')
|
||||||
|
|
||||||
|
@ -200,13 +184,9 @@ module Oga
|
||||||
self_test.followed_by(ancestors_test)
|
self_test.followed_by(ancestors_test)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes the `ancestor` axis.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_axis_ancestor(ast, input, &block)
|
def on_axis_ancestor(ast, input, &block)
|
||||||
parent = literal('parent')
|
parent = literal('parent')
|
||||||
|
|
||||||
|
@ -215,13 +195,9 @@ module Oga
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes a node test predicate.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_predicate(ast, input, &block)
|
def on_predicate(ast, input, &block)
|
||||||
test, predicate = *ast
|
test, predicate = *ast
|
||||||
|
|
||||||
|
@ -294,13 +270,9 @@ module Oga
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes a node test.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_test(ast, input)
|
def on_test(ast, input)
|
||||||
condition = element_or_attribute(input)
|
condition = element_or_attribute(input)
|
||||||
name_match = match_name_and_namespace(ast, input)
|
name_match = match_name_and_namespace(ast, input)
|
||||||
|
@ -308,59 +280,39 @@ module Oga
|
||||||
name_match ? condition.and(name_match) : condition
|
name_match ? condition.and(name_match) : condition
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes an equality expression.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_eq(ast, input)
|
def on_eq(ast, input)
|
||||||
left, right = *ast
|
left, right = *ast
|
||||||
|
|
||||||
process(left, input).eq(process(right, input))
|
process(left, input).eq(process(right, input))
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes a string.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_string(ast, *)
|
def on_string(ast, *)
|
||||||
string(ast.children[0])
|
string(ast.children[0])
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes an integer.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_int(ast, *)
|
def on_int(ast, *)
|
||||||
literal(ast.children[0].to_i.to_s)
|
literal(ast.children[0].to_i.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes a float.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_float(ast, *)
|
def on_float(ast, *)
|
||||||
literal(ast.children[0].to_s)
|
literal(ast.children[0].to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Processes a variable reference.
|
|
||||||
#
|
|
||||||
# @param [AST::Node] ast
|
# @param [AST::Node] ast
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
|
||||||
def on_var(ast, input)
|
def on_var(ast, input)
|
||||||
vars = variables_literal
|
vars = variables_literal
|
||||||
name = ast.children[0]
|
name = ast.children[0]
|
||||||
|
|
Loading…
Reference in New Issue