diff options
author | murphy <murphy@rubychan.de> | 2005-12-11 04:15:33 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2005-12-11 04:15:33 +0000 |
commit | 952c57ba77b5a36111b9f82f8632e58208c998c4 (patch) | |
tree | 8d043fa12c27893c9e8ea8d3596352ce0110f74e /lib | |
parent | e1aaa2c6c608aaf2577b49a72538d6fe7ceedc27 (diff) | |
download | coderay-952c57ba77b5a36111b9f82f8632e58208c998c4.tar.gz |
scanners/ruby/patterns.rb:
Changed recognition of numerics
+ and - prefixes now belong to the number.
tests and demos adjusted.
helpers/plugin.rb: Typo in doc.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coderay/helpers/plugin.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 233dfd6..6c3ce76 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -178,7 +178,7 @@ protected # Loads the map file (see map).
#
- # This is done automatically when plaugin_path is called.
+ # This is done automatically when plugin_path is called.
def load_map
begin
require path_to('_map')
diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index ad649da..2933109 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -71,7 +71,7 @@ module CodeRay 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 = /
:
|