From 13d7eac0b77f3ca280e12422104753d7651ab047 Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 21 Jan 2008 03:32:26 +0000 Subject: Improved Ruby scanner to use +/- signs only when appropriate (tests adjusted.) Ignore test/scanners/*/*.expected.html --- lib/coderay/scanners/ruby/patterns.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/coderay/scanners/ruby') diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index 88fd1e0..6f044f2 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -69,7 +69,7 @@ module Scanners EXPONENT = / [eE] [+-]? #{DECIMAL} /ox FLOAT_SUFFIX = / #{EXPONENT} | \. #{DECIMAL} #{EXPONENT}? /ox FLOAT_OR_INT = / #{DECIMAL} (?: #{FLOAT_SUFFIX} () )? /ox - NUMERIC = / [-+]? (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox + NUMERIC = / (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox SYMBOL = / : @@ -126,15 +126,14 @@ module Scanners /mx # Checks for a valid value to follow. This enables - # fancy_allowed in method calls. + # value_expected in method calls without parentheses. VALUE_FOLLOWS = / - \s+ + (?>[ \t\f\v]+) (?: [%\/][^\s=] - | - <<-?\S - | - #{CHARACTER} + | <<-?\S + | [-+] \d + | #{CHARACTER} ) /x -- cgit v1.2.1