diff options
author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:07:15 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:07:15 -0700 |
commit | 543225970225de5697734bfaf0a6eee996802c04 (patch) | |
tree | ecc6f639c43cf1812e64f9c6ce7eacc0922b57ff /lib/puppet/parser/lexer.rb | |
parent | 8f15707251cdb58d53e82c4bbd332a38c2d31b4c (diff) | |
download | puppet-543225970225de5697734bfaf0a6eee996802c04.tar.gz puppet-543225970225de5697734bfaf0a6eee996802c04.tar.xz puppet-543225970225de5697734bfaf0a6eee996802c04.zip |
Code smell: Avoid needless decorations
* Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2
3 Examples:
The code:
ctx = OpenSSL::SSL::SSLContext.new()
becomes:
ctx = OpenSSL::SSL::SSLContext.new
The code:
skip()
becomes:
skip
The code:
path = tempfile()
becomes:
path = tempfile
* Replaced 31 occurances of ^( *)end *#.* with \1end
3 Examples:
The code:
becomes:
The code:
end # Dir.foreach
becomes:
end
The code:
end # def
becomes:
end
Diffstat (limited to 'lib/puppet/parser/lexer.rb')
-rw-r--r-- | lib/puppet/parser/lexer.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 7668722d4..0c95142f9 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -368,7 +368,7 @@ class Puppet::Parser::Lexer def initialize @find = 0 @regex = 0 - initvars() + initvars end def initvars @@ -396,7 +396,7 @@ class Puppet::Parser::Lexer def munge_token(token, value) @line += 1 if token.incr_line - skip() if token.skip_text + skip if token.skip_text return if token.skip and not token.accumulate? @@ -442,7 +442,7 @@ class Puppet::Parser::Lexer lex_error "Invalid or empty string" unless @scanner # Skip any initial whitespace. - skip() + skip until token_queue.empty? and @scanner.eos? do yielded = false @@ -460,7 +460,7 @@ class Puppet::Parser::Lexer final_token, token_value = munge_token(matched_token, value) unless final_token - skip() + skip next end @@ -496,7 +496,7 @@ class Puppet::Parser::Lexer end end @previous_token = final_token - skip() + skip end @scanner = nil |