diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coderay/scanners/java.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby.rb | 10 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 4 | ||||
-rw-r--r-- | lib/coderay/styles/cycnus.rb | 2 | ||||
-rw-r--r-- | lib/coderay/tokens.rb | 2 |
5 files changed, 8 insertions, 12 deletions
diff --git a/lib/coderay/scanners/java.rb b/lib/coderay/scanners/java.rb index 73a2dc5..17c7eaa 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -20,7 +20,7 @@ module Scanners TYPES = %w[ boolean byte char class double enum float int interface long short void - ] << '[]' # String[] should be highlighted as a type + ] << '[]' # because int[] should be highlighted as a type DIRECTIVES = %w[ abstract extends final implements native private protected public static strictfp synchronized throws transient volatile diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 014ab7b..34a682b 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -287,7 +287,7 @@ module Scanners kind = :error match = (scan(/./mu) rescue nil) || getch if !unicode && match.size > 1 - # warn 'Switchig to unicode mode for char %p' % [match] + # warn 'Switching to unicode mode because of char %p' % [match] unicode = true unscan next @@ -342,12 +342,8 @@ module Scanners end elsif state == :alias_expected - begin - match = scan(unicode ? /(#{patterns::METHOD_NAME_OR_SYMBOL})([ \t]+)(#{patterns::METHOD_NAME_OR_SYMBOL})/uo : - /(#{patterns::METHOD_NAME_OR_SYMBOL})([ \t]+)(#{patterns::METHOD_NAME_OR_SYMBOL})/o) - rescue EncodingError - raise if $DEBUG - end + match = scan(unicode ? /(#{patterns::METHOD_NAME_OR_SYMBOL})([ \t]+)(#{patterns::METHOD_NAME_OR_SYMBOL})/uo : + /(#{patterns::METHOD_NAME_OR_SYMBOL})([ \t]+)(#{patterns::METHOD_NAME_OR_SYMBOL})/o) if match tokens << [self[1], (self[1][0] == ?: ? :symbol : :method)] diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index fc6ce56..576beda 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -182,7 +182,7 @@ module Scanners STRING_PATTERN = Hash.new do |h, k| delim, interpreted = *k - delim_pattern = Regexp.escape(delim.dup) # dup: Fix for x86_64-linux Ruby + delim_pattern = Regexp.escape(delim.dup) # dup: workaround for old Ruby if closing_paren = CLOSING_PAREN[delim] delim_pattern = delim_pattern[0..-1] if defined? JRUBY_VERSION # JRuby fix delim_pattern << Regexp.escape(closing_paren) @@ -207,7 +207,7 @@ module Scanners HEREDOC_PATTERN = Hash.new do |h, k| delim, interpreted, indented = *k - delim_pattern = Regexp.escape(delim.dup) + delim_pattern = Regexp.escape(delim.dup) # dup: workaround for old Ruby delim_pattern = / \n #{ '(?>[\ \t]*)' if indented } #{ Regexp.new delim_pattern } $ /x h[k] = if interpreted diff --git a/lib/coderay/styles/cycnus.rb b/lib/coderay/styles/cycnus.rb index 15ee4f4..d2a4353 100644 --- a/lib/coderay/styles/cycnus.rb +++ b/lib/coderay/styles/cycnus.rb @@ -97,7 +97,7 @@ ol.CodeRay li { white-space: pre } .pc { color:#038; font-weight:bold } .pd { color:#369; font-weight:bold } .pp { color:#579; } -.ps { color:#00C; font-weight:bold; } +.ps { color:#00C; font-weight:bold } .pt { color:#074; font-weight:bold } .r, .kw { color:#080; font-weight:bold } diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb index ec2b730..aa78ee7 100644 --- a/lib/coderay/tokens.rb +++ b/lib/coderay/tokens.rb @@ -14,7 +14,7 @@ module CodeRay # # [:comment, '# It looks like this'] # [:float, '3.1415926'] - # [:error, 'äöü'] + # [:error, '$^'] # # Some scanners also yield some kind of sub-tokens, represented by special # token texts, namely :open and :close . |