diff options
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/scanners/ruby.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 77fe664..1ad9d03 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -167,7 +167,7 @@ module Scanners end end ## experimental! - fancy_allowed = regexp_allowed = :set if patterns::REGEXP_ALLOWED[match] or check(/\s+(?:%\S|\/\S)/) + fancy_allowed = regexp_allowed = :set if patterns::REGEXP_ALLOWED[match] or check(/\s+[%\/][^\s=]/) # OPERATORS # elsif (not last_token_dot and match = scan(/ ==?=? | \.\.?\.? | [\(\)\[\]\{\}] | :: | , /x)) or diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index c601011..6023b21 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -21,7 +21,8 @@ module Scanners add(MODULE_KEYWORDS, :module_expected) IDENTS_ALLOWING_REGEXP = %w[ - and or not while until unless if then elsif when sub sub! gsub gsub! scan slice slice! split + and or not while until unless if then elsif when sub sub! gsub gsub! + scan slice slice! split ] REGEXP_ALLOWED = WordList.new(false). add(IDENTS_ALLOWING_REGEXP, :set) |