summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/scanners/ruby.rb')
-rw-r--r--lib/coderay/scanners/ruby.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index 0bc3e85..d7df1a1 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -103,7 +103,7 @@ module Scanners
when state.delim, '\\'
encoder.text_token match + m, :char
when nil
- encoder.text_token match, :error
+ encoder.text_token match, :content
else
encoder.text_token match + m, :content
end
@@ -237,7 +237,7 @@ module Scanners
encoder.begin_group :regexp
encoder.text_token match, :delimiter
interpreted = true
- state = patterns::StringState.new :regexp, interpreted, match
+ state = patterns::StringState.new :regexp, interpreted, '/'
elsif match = scan(value_expected ? /[-+]?#{patterns::NUMERIC}/o : /#{patterns::NUMERIC}/o)
if method_call_expected
@@ -316,6 +316,9 @@ module Scanners
encoder.text_token match, :class_variable
value_expected = false
+ elsif match = scan(/\\\z/)
+ encoder.text_token match, :space
+
else
if method_call_expected
method_call_expected = false