summaryrefslogtreecommitdiffstats
path: root/lib/puppet/reference/function.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-07-17 12:39:37 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-18 19:44:19 -0700
commit4822de3f95e08a745e727790e1a30e49064e1e43 (patch)
treebd3b26ce5a8a9304509c07f5dd6da296bd9ed707 /lib/puppet/reference/function.rb
parentb509032e559cb26e05863b2c290a543c6fa9d779 (diff)
downloadpuppet-4822de3f95e08a745e727790e1a30e49064e1e43.tar.gz
puppet-4822de3f95e08a745e727790e1a30e49064e1e43.tar.xz
puppet-4822de3f95e08a745e727790e1a30e49064e1e43.zip
Fix for #4236 -- Only interpolate $ if followed by a variable
This is a modification of the Nick/Jesse/Matt patch, retaining their tests and the analysis of the problem but reversing the implementation direction of the solution. Rather than trying to make the already somewhat brittle slurpstring smarter, which requires telling it what following strings will be accepted by the caller with a zero-width-lookahead negation of the regular expression used to extract a variable name, this patch keeps that responsibility in the caller where it belongs. The caller (tokenize_interpolated_string) now checks to see if it got a variable name _before_ emitting a variable token; if it got one, it proceeds normally, but if it didn't it simply tries again from that point in the string (accumulating the false match as a prefix). This change actually simplifies the logic of tokenize_interpolated_string somewhat.
Diffstat (limited to 'lib/puppet/reference/function.rb')
0 files changed, 0 insertions, 0 deletions