summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2019-11-24 01:29:32 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2019-11-24 01:29:32 +0100
commitc7e3b31f405b3669d823bda2f0f0ec3df64fdf2d (patch)
tree5ce13ad45a912d52514015f65f10b59dd7f6ba2b /lib/coderay
parent62f69934f2508a25df988157925667d5efd8549e (diff)
parent9907f88568691916e4a869bc44126de8040a274d (diff)
downloadcoderay-c7e3b31f405b3669d823bda2f0f0ec3df64fdf2d.tar.gz
Merge branch 'master' into fix-javascript-regexp
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/encoders/html/output.rb2
-rw-r--r--lib/coderay/scanners/java.rb2
-rw-r--r--lib/coderay/scanners/sql.rb2
-rw-r--r--lib/coderay/tokens.rb3
4 files changed, 5 insertions, 4 deletions
diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb
index de6f6ea..ee87fea 100644
--- a/lib/coderay/encoders/html/output.rb
+++ b/lib/coderay/encoders/html/output.rb
@@ -76,8 +76,6 @@ module Encoders
apply_title! title
end
self
- when nil
- return self
else
raise "Unknown value %p for :wrap" % element
end
diff --git a/lib/coderay/scanners/java.rb b/lib/coderay/scanners/java.rb
index 982a796..a490ec6 100644
--- a/lib/coderay/scanners/java.rb
+++ b/lib/coderay/scanners/java.rb
@@ -20,7 +20,7 @@ module Scanners
MAGIC_VARIABLES = %w[ this super ] # :nodoc:
TYPES = %w[
boolean byte char class double enum float int interface long
- short void
+ short void var
] << '[]' # :nodoc: because int[] should be highlighted as a type
DIRECTIVES = %w[
abstract extends final implements native private protected public
diff --git a/lib/coderay/scanners/sql.rb b/lib/coderay/scanners/sql.rb
index 7d57f77..c8725a8 100644
--- a/lib/coderay/scanners/sql.rb
+++ b/lib/coderay/scanners/sql.rb
@@ -29,7 +29,7 @@ module Scanners
char varchar varchar2 enum binary text tinytext mediumtext
longtext blob tinyblob mediumblob longblob timestamp
date time datetime year double decimal float int
- integer tinyint mediumint bigint smallint unsigned bit
+ integer tinyint mediumint bigint smallint unsigned bit numeric
bool boolean hex bin oct
)
diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb
index e7bffce..b5f78e7 100644
--- a/lib/coderay/tokens.rb
+++ b/lib/coderay/tokens.rb
@@ -39,6 +39,9 @@ module CodeRay
# You can serialize it to a JSON string and store it in a database, pass it
# around to encode it more than once, send it to other algorithms...
class Tokens < Array
+ # Remove Array#filter that is a new alias for Array#select on Ruby 2.6,
+ # for method_missing called with filter method.
+ undef_method :filter if instance_methods.include?(:filter)
# The Scanner instance that created the tokens.
attr_accessor :scanner