Removed some explicit returns in .rll files

This commit is contained in:
Yorick Peterse 2015-06-23 22:07:58 +02:00
parent 08c965bfbc
commit c25879f18e
3 changed files with 19 additions and 19 deletions

View File

@ -339,7 +339,7 @@ even
# @return [AST::Node] # @return [AST::Node]
# #
def self.parse_with_cache(data) def self.parse_with_cache(data)
return CACHE.get_or_set(data) { new(data).parse } CACHE.get_or_set(data) { new(data).parse }
end end
## ##
@ -362,7 +362,7 @@ even
# @return [AST::Node] # @return [AST::Node]
# #
def s(type, *children) def s(type, *children)
return AST::Node.new(type, children) AST::Node.new(type, children)
end end
## ##
@ -678,7 +678,7 @@ even
end end
end end
return node node
end end
## ##

View File

@ -302,7 +302,7 @@ string_body
reset reset
return retval retval
end end
## ##
@ -324,14 +324,14 @@ string_body
end end
end end
return document document
end end
## ##
# @param [Hash] options # @param [Hash] options
# #
def on_doctype(options = {}) def on_doctype(options = {})
return Doctype.new(options) Doctype.new(options)
end end
## ##
@ -339,7 +339,7 @@ string_body
# @return [Oga::XML::Cdata] # @return [Oga::XML::Cdata]
# #
def on_cdata(text = nil) def on_cdata(text = nil)
return Cdata.new(:text => text) Cdata.new(:text => text)
end end
## ##
@ -347,7 +347,7 @@ string_body
# @return [Oga::XML::Comment] # @return [Oga::XML::Comment]
# #
def on_comment(text = nil) def on_comment(text = nil)
return Comment.new(:text => text) Comment.new(:text => text)
end end
## ##
@ -356,7 +356,7 @@ string_body
# @return [Oga::XML::ProcessingInstruction] # @return [Oga::XML::ProcessingInstruction]
# #
def on_proc_ins(name, text = nil) def on_proc_ins(name, text = nil)
return ProcessingInstruction.new(:name => name, :text => text) ProcessingInstruction.new(:name => name, :text => text)
end end
## ##
@ -370,7 +370,7 @@ string_body
options[attr.name.to_sym] = attr.value options[attr.name.to_sym] = attr.value
end end
return XmlDeclaration.new(options) XmlDeclaration.new(options)
end end
## ##
@ -378,7 +378,7 @@ string_body
# @return [Oga::XML::Text] # @return [Oga::XML::Text]
# #
def on_text(text) def on_text(text)
return Text.new(:text => text) Text.new(:text => text)
end end
## ##
@ -394,7 +394,7 @@ string_body
:attributes => attributes :attributes => attributes
) )
return element element
end end
## ##
@ -405,7 +405,7 @@ string_body
def on_element_children(element, children = []) def on_element_children(element, children = [])
element.children = children element.children = children
return element element
end end
## ##
@ -413,7 +413,7 @@ string_body
# @return [Oga::XML::Element] # @return [Oga::XML::Element]
# #
def after_element(element) def after_element(element)
return element element
end end
## ##
@ -423,7 +423,7 @@ string_body
# @return [Oga::XML::Attribute] # @return [Oga::XML::Attribute]
# #
def on_attribute(name, ns_name = nil, value = nil) def on_attribute(name, ns_name = nil, value = nil)
return Attribute.new( Attribute.new(
:namespace_name => ns_name, :namespace_name => ns_name,
:name => name, :name => name,
:value => value :value => value
@ -434,6 +434,6 @@ string_body
# @param [Array] attrs # @param [Array] attrs
# #
def on_attributes(attrs) def on_attributes(attrs)
return attrs attrs
end end
} }

View File

@ -235,7 +235,7 @@ variable
# @return [AST::Node] # @return [AST::Node]
# #
def self.parse_with_cache(data) def self.parse_with_cache(data)
return CACHE.get_or_set(data) { new(data).parse } CACHE.get_or_set(data) { new(data).parse }
end end
## ##
@ -253,7 +253,7 @@ variable
# @return [AST::Node] # @return [AST::Node]
# #
def s(type, *children) def s(type, *children)
return AST::Node.new(type, children) AST::Node.new(type, children)
end end
## ##
@ -281,7 +281,7 @@ variable
ret = s(expr[0], ret, expr[1]) ret = s(expr[0], ret, expr[1])
end end
return ret ret
end end
## ##