Skip to content

Commit 080f8a8

Browse files
committed
add support for Ruby 2.1 number literal suffixes
1 parent cb18c6a commit 080f8a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/coderay/scanners/ruby.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ def scan_tokens encoder, options
191191
encoder.text_token match, :error
192192
method_call_expected = false
193193
else
194-
encoder.text_token match, self[1] ? :float : :integer # TODO: send :hex/:octal/:binary
194+
kind = self[1] ? :float : :integer # TODO: send :hex/:octal/:binary
195+
match << 'r' if match !~ /e/i && scan(/r/)
196+
match << 'i' if scan(/i/)
197+
encoder.text_token match, kind
195198
end
196199
value_expected = false
197200

0 commit comments

Comments
 (0)