Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adjust lexer hacks to support 0.25 Puppet

  • Loading branch information...
commit 6bcb2b645e20b610eed6a56416a971d3e6752852 1 parent a401133
@rodjek authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/puppet-lint/plugins/check_strings.rb
View
11 lib/puppet-lint/plugins/check_strings.rb
@@ -9,8 +9,15 @@ def del_token(token)
TOKENS.add_tokens("<single quotes string>" => :SSTRING)
TOKENS.del_token(:SQUOTE)
- TOKENS.add_token :SQUOTE, "'" do |lexer, value|
- [TOKENS[:SSTRING], lexer.slurpstring(value,["'"],:ignore_invalid_escapes).first ]
+ if Puppet::PUPPETVERSION =~ /^0\.2/
+ TOKENS.add_token :SQUOTE, "'" do |lexer, value|
+ value = lexer.slurpstring(value)
+ [TOKENS[:SSTRING], value]
+ end
+ else
+ TOKENS.add_token :SQUOTE, "'" do |lexer, value|
+ [ TOKENS[:SSTRING], lexer.slurpstring(value,["'"],:ignore_invalid_escapes).first ]
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.