From b510e92787bd0c2ff7b77e933adc2a15ba862026 Mon Sep 17 00:00:00 2001 From: murphy Date: Wed, 30 Dec 2009 07:16:09 +0000 Subject: Cleanups. --- lib/coderay/scanners/ruby.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/coderay/scanners/ruby.rb') 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)] -- cgit v1.2.1