[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:33:59 UTC 2010


The following commit has been merged in the upstream branch:
commit b5db33bc2a639984cda9a651abe57d044c14f23d
Author: Markus Roberts <Markus at reality.com>
Date:   Mon Jun 7 15:25:21 2010 -0700

    Fix for 3664: interpolating qualified variables.
    
    "${myclass::var}" was lexed as a CLASSNAME instead of a VARIABLE token,
    giving an error while parsing because a rvalue can't be a bare CLASSNAME
    token.
    
    This commit (based of Brice's) fixes it by restricting the contexts in which
    the CLASSNAME and CLASSREF tokens are acceptable, analagous with the handling
    for NAME tokens.

diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index c3c53a5..7adb0b6 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -108,12 +108,6 @@ class Puppet::Parser::Lexer
     end
 
     TOKENS = TokenList.new
-
-    TOKENS.add_token :VARIABLE, %r{(\w*::)*\w+}
-    def (TOKENS[:VARIABLE]).acceptable?(context={})
-        [:DQPRE,:DQMID].include? context[:after]
-    end
-
     TOKENS.add_tokens(
         '[' => :LBRACK,
         ']' => :RBRACK,
@@ -183,9 +177,11 @@ class Puppet::Parser::Lexer
         end
         [string_token, value]
     end
-    def (TOKENS[:NAME]).acceptable?(context={})
-        ![:DQPRE,:DQMID].include? context[:after]
-    end
+    [:NAME,:CLASSNAME,:CLASSREF].each { |name_token|
+        def (TOKENS[name_token]).acceptable?(context={})
+            ![:DQPRE,:DQMID].include? context[:after]
+        end
+    }
 
     TOKENS.add_token :COMMENT, %r{#.*}, :accumulate => true, :skip => true do |lexer,value|
         value.sub!(/# ?/,'')
@@ -237,6 +233,10 @@ class Puppet::Parser::Lexer
         [TOKENS[:VARIABLE],value[1..-1]]
     end
 
+    TOKENS.add_token :VARIABLE, %r{(\w*::)*\w+}
+    def (TOKENS[:VARIABLE]).acceptable?(context={})
+        [:DQPRE,:DQMID].include? context[:after]
+    end
 
 
     TOKENS.sort_tokens

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list