From ec08216346b0d73b9118dbf498cff675924d40b0 Mon Sep 17 00:00:00 2001 From: murphy Date: Wed, 18 Oct 2006 10:28:21 +0000 Subject: Fixed warning in bench.rb. Ruby Scanner: improved handling of ambiguos values. - operator methods are now :ident instead of :operator - fancy_allowed and regexp_allowed are now value_expected - value_expected works in operator method calls - tests enhanced and adjusted Scanner tests: new diffed option, diff doesn't imply noassert anymore --- lib/coderay/scanners/ruby/patterns.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/coderay/scanners/ruby/patterns.rb') diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index 6023b21..51cdb95 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -127,6 +127,19 @@ module Scanners .*? (?: \Z | (?=^\#CODE) ) /mx + + # Checks for a valid value to follow. This enables + # fancy_allowed in method calls. + VALUE_FOLLOWS = / + \s+ + (?: + [%\/][^\s=] + | + <<-?\S + | + #{CHARACTER} + ) + /x RUBYDOC_OR_DATA = / #{RUBYDOC} | #{DATA} /xo -- cgit v1.2.1