summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-03-24 21:58:29 +0000
committermurphy <murphy@rubychan.de>2006-03-24 21:58:29 +0000
commit0d919d07f67166981cea476e1febbc40af2eae9c (patch)
treef776062bf24c2425f73ee3af5f8a031e7c867b39 /lib/coderay/scanners/ruby.rb
parent7863986fad84f56ba537ce3714d614c33391fd85 (diff)
downloadcoderay-0d919d07f67166981cea476e1febbc40af2eae9c.tar.gz
Ruby Scanner: Capital methods (Kernel#Array etc.) are now highlighted as idents.
Tests adjusted. highlight.rb updated.
Diffstat (limited to 'lib/coderay/scanners/ruby.rb')
-rw-r--r--lib/coderay/scanners/ruby.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index 8952422..dd92caf 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -188,10 +188,10 @@ module CodeRay module Scanners
# IDENTS #
if match = scan(/#{METHOD_NAME}/o)
if last_token_dot
- type = if match[/^[A-Z]/] then :constant else :ident end
+ type = if match[/^[A-Z]/] and not match?(/\(/) then :constant else :ident end
else
type = IDENT_KIND[match]
- if type == :ident and match[/^[A-Z]/] and not match[/[!?]$/]
+ if type == :ident and match[/^[A-Z]/] and not match[/[!?]$/] and not match?(/\(/)
type = :constant
elsif type == :reserved
state = DEF_NEW_STATE[match]