diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2010-04-23 20:41:29 +0200 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 9ddee72e05af79ab7f453b37e9497dca33f7d5ba (patch) | |
| tree | bf0a233689c15f54a1c76fd8eb0fe32383233728 /spec/unit/parser | |
| parent | a32381e822779b56030f6bd7009cd978970cecd2 (diff) | |
| download | puppet-9ddee72e05af79ab7f453b37e9497dca33f7d5ba.tar.gz puppet-9ddee72e05af79ab7f453b37e9497dca33f7d5ba.tar.xz puppet-9ddee72e05af79ab7f453b37e9497dca33f7d5ba.zip | |
Fix #3664 - qualified variable parsing in string interpolation
"${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 patch fixes the issue by making VARIABLE lexing higher priority than
CLASSNAME.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/lexer.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/unit/parser/lexer.rb b/spec/unit/parser/lexer.rb index b1524f1e0..204cde759 100755 --- a/spec/unit/parser/lexer.rb +++ b/spec/unit/parser/lexer.rb @@ -413,6 +413,7 @@ describe Puppet::Parser::Lexer,"when lexing strings" do %q["string with an escaped '\\$'"] => [[:STRING,"string with an escaped '$'"]], %q["string with $v (but no braces)"] => [[:DQPRE,"string with "],[:VARIABLE,'v'],[:DQPOST,' (but no braces)']], %q["string with ${v} in braces"] => [[:DQPRE,"string with "],[:VARIABLE,'v'],[:DQPOST,' in braces']], + %q["string with ${qualified::var} in braces"] => [[:DQPRE,"string with "],[:VARIABLE,'qualified::var'],[:DQPOST,' in braces']], %q["string with $v and $v (but no braces)"] => [[:DQPRE,"string with "],[:VARIABLE,"v"],[:DQMID," and "],[:VARIABLE,"v"],[:DQPOST," (but no braces)"]], %q["string with ${v} and ${v} in braces"] => [[:DQPRE,"string with "],[:VARIABLE,"v"],[:DQMID," and "],[:VARIABLE,"v"],[:DQPOST," in braces"]], %q["string with ${'a nested single quoted string'} inside it."] => [[:DQPRE,"string with "],[:STRING,'a nested single quoted string'],[:DQPOST,' inside it.']], |
