From c25879f18e1ffbab957f3f9a2456ac21373022d6 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 23 Jun 2015 22:07:58 +0200 Subject: [PATCH] Removed some explicit returns in .rll files --- lib/oga/css/parser.rll | 6 +++--- lib/oga/xml/parser.rll | 26 +++++++++++++------------- lib/oga/xpath/parser.rll | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/oga/css/parser.rll b/lib/oga/css/parser.rll index cc0aae6..4b153f8 100644 --- a/lib/oga/css/parser.rll +++ b/lib/oga/css/parser.rll @@ -339,7 +339,7 @@ even # @return [AST::Node] # def self.parse_with_cache(data) - return CACHE.get_or_set(data) { new(data).parse } + CACHE.get_or_set(data) { new(data).parse } end ## @@ -362,7 +362,7 @@ even # @return [AST::Node] # def s(type, *children) - return AST::Node.new(type, children) + AST::Node.new(type, children) end ## @@ -678,7 +678,7 @@ even end end - return node + node end ## diff --git a/lib/oga/xml/parser.rll b/lib/oga/xml/parser.rll index bf79942..c1d33e5 100644 --- a/lib/oga/xml/parser.rll +++ b/lib/oga/xml/parser.rll @@ -302,7 +302,7 @@ string_body reset - return retval + retval end ## @@ -324,14 +324,14 @@ string_body end end - return document + document end ## # @param [Hash] options # def on_doctype(options = {}) - return Doctype.new(options) + Doctype.new(options) end ## @@ -339,7 +339,7 @@ string_body # @return [Oga::XML::Cdata] # def on_cdata(text = nil) - return Cdata.new(:text => text) + Cdata.new(:text => text) end ## @@ -347,7 +347,7 @@ string_body # @return [Oga::XML::Comment] # def on_comment(text = nil) - return Comment.new(:text => text) + Comment.new(:text => text) end ## @@ -356,7 +356,7 @@ string_body # @return [Oga::XML::ProcessingInstruction] # def on_proc_ins(name, text = nil) - return ProcessingInstruction.new(:name => name, :text => text) + ProcessingInstruction.new(:name => name, :text => text) end ## @@ -370,7 +370,7 @@ string_body options[attr.name.to_sym] = attr.value end - return XmlDeclaration.new(options) + XmlDeclaration.new(options) end ## @@ -378,7 +378,7 @@ string_body # @return [Oga::XML::Text] # def on_text(text) - return Text.new(:text => text) + Text.new(:text => text) end ## @@ -394,7 +394,7 @@ string_body :attributes => attributes ) - return element + element end ## @@ -405,7 +405,7 @@ string_body def on_element_children(element, children = []) element.children = children - return element + element end ## @@ -413,7 +413,7 @@ string_body # @return [Oga::XML::Element] # def after_element(element) - return element + element end ## @@ -423,7 +423,7 @@ string_body # @return [Oga::XML::Attribute] # def on_attribute(name, ns_name = nil, value = nil) - return Attribute.new( + Attribute.new( :namespace_name => ns_name, :name => name, :value => value @@ -434,6 +434,6 @@ string_body # @param [Array] attrs # def on_attributes(attrs) - return attrs + attrs end } diff --git a/lib/oga/xpath/parser.rll b/lib/oga/xpath/parser.rll index d848dfc..430f3d7 100644 --- a/lib/oga/xpath/parser.rll +++ b/lib/oga/xpath/parser.rll @@ -235,7 +235,7 @@ variable # @return [AST::Node] # def self.parse_with_cache(data) - return CACHE.get_or_set(data) { new(data).parse } + CACHE.get_or_set(data) { new(data).parse } end ## @@ -253,7 +253,7 @@ variable # @return [AST::Node] # def s(type, *children) - return AST::Node.new(type, children) + AST::Node.new(type, children) end ## @@ -281,7 +281,7 @@ variable ret = s(expr[0], ret, expr[1]) end - return ret + ret end ##