summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-01-22 14:34:17 +0000
committermurphy <murphy@rubychan.de>2009-01-22 14:34:17 +0000
commit7c653b9bafc2159431c86b628d5279913e7ec74d (patch)
tree557ba006214b7ee2b27e389021259fe548091b16
parent6bc606076474d8ddcd5503ea31ff0ba3880520f9 (diff)
downloadcoderay-7c653b9bafc2159431c86b628d5279913e7ec74d.tar.gz
Fixed a Ruby 1.8 compatibility bug in Groovy Scanner.
* Also added jruby19 task (jruby --1.9 mode).
-rw-r--r--Rakefile4
-rw-r--r--lib/coderay/scanners/groovy.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 780b5d4..0537521 100644
--- a/Rakefile
+++ b/Rakefile
@@ -45,6 +45,10 @@ task 'jruby' do
RUBY.replace 'jruby'
end
+task 'jruby19' do
+ RUBY.replace 'jruby --1.9'
+end
+
task 'rubinius' do
RUBY.replace 'rbx'
end
diff --git a/lib/coderay/scanners/groovy.rb b/lib/coderay/scanners/groovy.rb
index fd1a34b..9486beb 100644
--- a/lib/coderay/scanners/groovy.rb
+++ b/lib/coderay/scanners/groovy.rb
@@ -201,7 +201,7 @@ module Scanners
elsif (state == :string || state == :multiline_string) &&
(match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox))
- if string_delimiter[0] == "'" && !(match == "\\\\" || match == "\\'")
+ if string_delimiter[0] == ?' && !(match == "\\\\" || match == "\\'")
kind = :content
else
kind = :char