diff options
author | murphy <murphy@rubychan.de> | 2008-01-21 03:32:26 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2008-01-21 03:32:26 +0000 |
commit | 13d7eac0b77f3ca280e12422104753d7651ab047 (patch) | |
tree | 60f179f8bb2c1b0e273d96797394f65d5c49a1d1 /lib/coderay/scanners/ruby | |
parent | c545052548086962c61bb6ef79d16b5959aae936 (diff) | |
download | coderay-13d7eac0b77f3ca280e12422104753d7651ab047.tar.gz |
Improved Ruby scanner to use +/- signs only when appropriate (tests adjusted.)
Ignore test/scanners/*/*.expected.html
Diffstat (limited to 'lib/coderay/scanners/ruby')
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 13 |
1 files changed, 6 insertions, 7 deletions
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 |