summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorIan Taylor <ian@lorf.org>2009-06-05 12:39:04 -0400
committerJames Turnbull <james@lovedthanlost.net>2009-06-06 09:12:00 +1000
commit4f2c066a97e59a89df64af4b25beac6f3f0553c2 (patch)
tree126540beec3c65448e01e1b48d27275ec4ee6ea4 /lib/puppet/parser
parent97e6975d69f239e24993315a25a3117b1daa48c3 (diff)
downloadpuppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.gz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.xz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.zip
Removed extra whitespace from end of lines
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/astarray.rb2
-rw-r--r--lib/puppet/parser/ast/boolean_operator.rb6
-rw-r--r--lib/puppet/parser/ast/casestatement.rb2
-rw-r--r--lib/puppet/parser/ast/collexpr.rb2
-rw-r--r--lib/puppet/parser/ast/comparison_operator.rb2
-rw-r--r--lib/puppet/parser/ast/resource_defaults.rb2
-rw-r--r--lib/puppet/parser/ast/resource_override.rb2
-rw-r--r--lib/puppet/parser/ast/resource_reference.rb2
-rw-r--r--lib/puppet/parser/ast/selector.rb4
-rw-r--r--lib/puppet/parser/functions.rb2
-rw-r--r--lib/puppet/parser/functions/fqdn_rand.rb6
-rw-r--r--lib/puppet/parser/functions/inline_template.rb8
-rw-r--r--lib/puppet/parser/functions/regsubst.rb4
-rw-r--r--lib/puppet/parser/functions/template.rb8
-rw-r--r--lib/puppet/parser/grammar.ra14
-rw-r--r--lib/puppet/parser/interpreter.rb2
-rw-r--r--lib/puppet/parser/lexer.rb6
-rw-r--r--lib/puppet/parser/parser_support.rb2
-rw-r--r--lib/puppet/parser/resource.rb4
-rw-r--r--lib/puppet/parser/resource/param.rb2
-rw-r--r--lib/puppet/parser/scope.rb14
-rw-r--r--lib/puppet/parser/templatewrapper.rb2
22 files changed, 49 insertions, 49 deletions
diff --git a/lib/puppet/parser/ast/astarray.rb b/lib/puppet/parser/ast/astarray.rb
index 8f09aa922..9b59d196a 100644
--- a/lib/puppet/parser/ast/astarray.rb
+++ b/lib/puppet/parser/ast/astarray.rb
@@ -19,7 +19,7 @@ class Puppet::Parser::AST
# Make a new array, so we don't have to deal with the details of
# flattening and such
items = []
-
+
# First clean out any AST::ASTArrays
@children.each { |child|
if child.instance_of?(AST::ASTArray)
diff --git a/lib/puppet/parser/ast/boolean_operator.rb b/lib/puppet/parser/ast/boolean_operator.rb
index c3b5c7d41..160e0e69e 100644
--- a/lib/puppet/parser/ast/boolean_operator.rb
+++ b/lib/puppet/parser/ast/boolean_operator.rb
@@ -16,7 +16,7 @@ class Puppet::Parser::AST
def evaluate(scope)
# evaluate the first operand, should return a boolean value
lval = @lval.safeevaluate(scope)
-
+
# return result
# lazy evaluate right operand
case @operator
@@ -27,8 +27,8 @@ class Puppet::Parser::AST
else # false and false == false
false
end
- when "or";
- if Puppet::Parser::Scope.true?(lval)
+ when "or";
+ if Puppet::Parser::Scope.true?(lval)
true
else
rval = @rval.safeevaluate(scope)
diff --git a/lib/puppet/parser/ast/casestatement.rb b/lib/puppet/parser/ast/casestatement.rb
index 73fbdcf1e..072747932 100644
--- a/lib/puppet/parser/ast/casestatement.rb
+++ b/lib/puppet/parser/ast/casestatement.rb
@@ -17,7 +17,7 @@ class Puppet::Parser::AST
retvalue = nil
found = false
-
+
# Iterate across the options looking for a match.
default = nil
@options.each { |option|
diff --git a/lib/puppet/parser/ast/collexpr.rb b/lib/puppet/parser/ast/collexpr.rb
index 6ade58b7e..85bca583f 100644
--- a/lib/puppet/parser/ast/collexpr.rb
+++ b/lib/puppet/parser/ast/collexpr.rb
@@ -67,7 +67,7 @@ class CollExpr < AST::Branch
else
str = "(%s) %s (%s)" % [str1, oper, str2]
end
-
+
return str, code
end
diff --git a/lib/puppet/parser/ast/comparison_operator.rb b/lib/puppet/parser/ast/comparison_operator.rb
index 3af86efea..0d2f8b16d 100644
--- a/lib/puppet/parser/ast/comparison_operator.rb
+++ b/lib/puppet/parser/ast/comparison_operator.rb
@@ -21,7 +21,7 @@ class Puppet::Parser::AST
# convert to number if operands are number
lval = Puppet::Parser::Scope.number?(lval) || lval
rval = Puppet::Parser::Scope.number?(rval) || rval
-
+
# return result
unless @operator == '!='
lval.send(@operator,rval)
diff --git a/lib/puppet/parser/ast/resource_defaults.rb b/lib/puppet/parser/ast/resource_defaults.rb
index ed83d3573..3fde7ade2 100644
--- a/lib/puppet/parser/ast/resource_defaults.rb
+++ b/lib/puppet/parser/ast/resource_defaults.rb
@@ -2,7 +2,7 @@ require 'puppet/parser/ast/branch'
class Puppet::Parser::AST
# A statement syntactically similar to an ResourceDef, but uses a
- # capitalized object type and cannot have a name.
+ # capitalized object type and cannot have a name.
class ResourceDefaults < AST::Branch
attr_accessor :type, :params
diff --git a/lib/puppet/parser/ast/resource_override.rb b/lib/puppet/parser/ast/resource_override.rb
index f8cf3a81e..5eac50982 100644
--- a/lib/puppet/parser/ast/resource_override.rb
+++ b/lib/puppet/parser/ast/resource_override.rb
@@ -34,7 +34,7 @@ class Puppet::Parser::AST
# Now we just create a normal resource, but we call a very different
# method on the scope.
resource = [resource] unless resource.is_a?(Array)
-
+
resource = resource.collect do |r|
res = Puppet::Parser::Resource.new(
:type => r.type,
diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb
index e5e2dce99..5a521494f 100644
--- a/lib/puppet/parser/ast/resource_reference.rb
+++ b/lib/puppet/parser/ast/resource_reference.rb
@@ -25,7 +25,7 @@ class Puppet::Parser::AST
def evaluate(scope)
title = @title.safeevaluate(scope)
title = [title] unless title.is_a?(Array)
-
+
if @type.to_s.downcase == "class"
resource_type = "class"
title = title.collect { |t| qualified_class(scope, t) }
diff --git a/lib/puppet/parser/ast/selector.rb b/lib/puppet/parser/ast/selector.rb
index 399d405a3..ecad163d4 100644
--- a/lib/puppet/parser/ast/selector.rb
+++ b/lib/puppet/parser/ast/selector.rb
@@ -17,9 +17,9 @@ class Puppet::Parser::AST
# Get our parameter.
paramvalue = @param.safeevaluate(scope)
-
+
sensitive = Puppet[:casesensitive]
-
+
if ! sensitive and paramvalue.respond_to?(:downcase)
paramvalue = paramvalue.downcase
end
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb
index 0434e9b48..a0e629a5b 100644
--- a/lib/puppet/parser/functions.rb
+++ b/lib/puppet/parser/functions.rb
@@ -120,7 +120,7 @@ module Functions
return false
end
end
-
+
# Runs a newfunction to create a function for each of the log levels
Puppet::Util::Log.levels.each do |level|
diff --git a/lib/puppet/parser/functions/fqdn_rand.rb b/lib/puppet/parser/functions/fqdn_rand.rb
index 2ae46de82..3741d2d32 100644
--- a/lib/puppet/parser/functions/fqdn_rand.rb
+++ b/lib/puppet/parser/functions/fqdn_rand.rb
@@ -1,6 +1,6 @@
-Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
- "Generates random numbers based on the node's fqdn. The first argument
- sets the range. The second argument specifies a number to add to the
+Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
+ "Generates random numbers based on the node's fqdn. The first argument
+ sets the range. The second argument specifies a number to add to the
seed and is optional.") do |args|
require 'md5'
max = args[0]
diff --git a/lib/puppet/parser/functions/inline_template.rb b/lib/puppet/parser/functions/inline_template.rb
index 289740873..b9547cac7 100644
--- a/lib/puppet/parser/functions/inline_template.rb
+++ b/lib/puppet/parser/functions/inline_template.rb
@@ -1,7 +1,7 @@
-Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :doc =>
- "Evaluate a template string and return its value. See `the templating docs
- </trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
- if multiple template strings are specified, their output is all concatenated
+Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :doc =>
+ "Evaluate a template string and return its value. See `the templating docs
+ </trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
+ if multiple template strings are specified, their output is all concatenated
and returned as the output of the function.") do |vals|
require 'erb'
diff --git a/lib/puppet/parser/functions/regsubst.rb b/lib/puppet/parser/functions/regsubst.rb
index 8a1a244ab..e6b98eb2c 100644
--- a/lib/puppet/parser/functions/regsubst.rb
+++ b/lib/puppet/parser/functions/regsubst.rb
@@ -1,7 +1,7 @@
module Puppet::Parser::Functions
newfunction(:regsubst, :type => :rvalue,
:doc => "
- Perform regexp replacement on a string.
+ Perform regexp replacement on a string.
- **Parameters** (in order):
@@ -19,7 +19,7 @@ module Puppet::Parser::Functions
- **G** Global replacement; all occurrences of the regexp in the string will be replaced. Without this, only the first occurrence will be replaced.
:lang: Optional. How to handle multibyte characters. A single-character string with the following values:
-
+
- **N** None
- **E** EUC
- **S** SJIS
diff --git a/lib/puppet/parser/functions/template.rb b/lib/puppet/parser/functions/template.rb
index 2eaace1d7..0a4cfc7aa 100644
--- a/lib/puppet/parser/functions/template.rb
+++ b/lib/puppet/parser/functions/template.rb
@@ -1,7 +1,7 @@
-Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
- "Evaluate a template and return its value. See `the templating docs
- </trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
- if multiple templates are specified, their output is all concatenated
+Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
+ "Evaluate a template and return its value. See `the templating docs
+ </trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
+ if multiple templates are specified, their output is all concatenated
and returned as the output of the function.") do |vals|
require 'erb'
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra
index 9da2999df..d7828d71a 100644
--- a/lib/puppet/parser/grammar.ra
+++ b/lib/puppet/parser/grammar.ra
@@ -471,10 +471,10 @@ else: # nothing
# Unlike yacc/bison, it seems racc
# gives tons of shift/reduce warnings
# with the following syntax:
-#
+#
# expression: ...
# | expression arithop expressio { ... }
-#
+#
# arithop: PLUS | MINUS | DIVIDE | TIMES ...
#
# So I had to develop the expression by adding one rule
@@ -525,10 +525,10 @@ expression: rvalue
}
| expression AND expression {
result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2]
-}
+}
| expression OR expression {
result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2]
-}
+}
| LPAREN expression RPAREN {
result = val[1]
}
@@ -578,9 +578,9 @@ selector: selectlhand QMARK svalues {
}
svalues: selectval
- | LBRACE sintvalues endcomma RBRACE {
+ | LBRACE sintvalues endcomma RBRACE {
@lexer.commentpop
- result = val[1]
+ result = val[1]
}
sintvalues: selectval
@@ -670,7 +670,7 @@ classname: NAME
# Multiple hostnames, as used for node names. These are all literal
# strings, not AST objects.
-hostnames: hostname
+hostnames: hostname
| hostnames COMMA hostname {
result = val[0]
result = [result] unless result.is_a?(Array)
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index c728b54a2..2e8924090 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -36,7 +36,7 @@ class Puppet::Parser::Interpreter
# create our interpreter
def initialize
# The class won't always be defined during testing.
- if Puppet[:storeconfigs]
+ if Puppet[:storeconfigs]
if Puppet.features.rails?
Puppet::Rails.init
else
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index a7b87e6d1..8bbcb84fb 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -281,11 +281,11 @@ class Puppet::Parser::Lexer
# I tried optimizing based on the first char, but it had
# a slightly negative affect and was a good bit more complicated.
TOKENS.regex_tokens.each do |token|
- next unless match_length = @scanner.match?(token.regex)
-
+ next unless match_length = @scanner.match?(token.regex)
+
# We've found a longer match
if match_length > length
- value = @scanner.scan(token.regex)
+ value = @scanner.scan(token.regex)
length = value.length
matched_token = token
end
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index 3a6853f27..1d81e6099 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -476,7 +476,7 @@ class Puppet::Parser::Parser
private
def check_and_add_to_watched_files(filename)
- unless @files.include?(filename)
+ unless @files.include?(filename)
@files[filename] = Puppet::Util::LoadedFile.new(filename)
return true
else
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 17bf7867a..32ea4573c 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -285,7 +285,7 @@ class Puppet::Parser::Resource
def to_ral
to_resource.to_ral
end
-
+
private
# Add default values from our definition.
@@ -360,7 +360,7 @@ class Puppet::Parser::Resource
def paramcheck(param)
param = param.to_s
# Now make sure it's a valid argument to our class. These checks
- # are organized in order of commonhood -- most types, it's a valid
+ # are organized in order of commonhood -- most types, it's a valid
# argument and paramcheck is enabled.
if @ref.typeclass.validattr?(param)
true
diff --git a/lib/puppet/parser/resource/param.rb b/lib/puppet/parser/resource/param.rb
index 0662ce953..f44d5a6e9 100644
--- a/lib/puppet/parser/resource/param.rb
+++ b/lib/puppet/parser/resource/param.rb
@@ -20,7 +20,7 @@ class Puppet::Parser::Resource::Param
def line_to_i
return line ? Integer(line) : nil
end
-
+
def to_s
"%s => %s" % [self.name, self.value]
end
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index b1f480ca6..0a182fe1d 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -49,7 +49,7 @@ class Puppet::Parser::Scope
unless value.is_a?(Fixnum) or value.is_a?(Bignum) or value.is_a?(Float) or value.is_a?(String)
return nil
end
-
+
if value.is_a?(String)
if value =~ /^-?\d+(:?\.\d+|(:?\.\d+)?e\d+)$/
return value.to_f
@@ -198,7 +198,7 @@ class Puppet::Parser::Scope
else
return @symtable[name]
end
- elsif self.parent
+ elsif self.parent
return parent.lookupvar(name, usestring)
elsif usestring
return ""
@@ -215,12 +215,12 @@ class Puppet::Parser::Scope
target = parent.to_hash(recursive)
end
target ||= Hash.new
- @symtable.keys.each { |name|
+ @symtable.keys.each { |name|
value = @symtable[name]
if value == :undef then
target.delete(name)
else
- target[name] = value
+ target[name] = value
end
}
return target
@@ -301,7 +301,7 @@ class Puppet::Parser::Scope
end
raise error
end
-
+
unless append
@symtable[name] = value
else # append case
@@ -322,7 +322,7 @@ class Puppet::Parser::Scope
ss = StringScanner.new(string)
out = ""
while not ss.eos?
- if ss.scan(/^\$\{((\w*::)*\w+)\}|^\$((\w*::)*\w+)/)
+ if ss.scan(/^\$\{((\w*::)*\w+)\}|^\$((\w*::)*\w+)/)
# If it matches the backslash, then just retun the dollar sign.
if ss.matched == '\\$'
out << '$'
@@ -357,7 +357,7 @@ class Puppet::Parser::Scope
out << '$'
elsif ss.scan(/^\\\n/) # an escaped carriage return
next
- else
+ else
tmp = ss.scan(/[^\\$]+/)
# Puppet.debug("Got other: pos:%d; m:%s" % [ss.pos, tmp])
unless tmp
diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb
index 97b454569..b2eb3c422 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -91,7 +91,7 @@ class Puppet::Parser::TemplateWrapper
# current object, making it possible to access them without conflict
# to the regular methods.
benchmark(:debug, "Bound template variables for #{template_source}") do
- scope.to_hash.each { |name, value|
+ scope.to_hash.each { |name, value|
if name.kind_of?(String)
realname = name.gsub(/[^\w]/, "_")
else