1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/scanf.rb: fix %[egEFG] isn't accept.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-03-28 00:56:35 +00:00
parent c08277c62d
commit 63dd50961e
3 changed files with 12 additions and 8 deletions

View file

@ -409,11 +409,11 @@ module Scanf
[ "([-+][0-7]{1,#{$1.to_i-1}}|[0-7]{1,#{$1}})", :extract_octal ]
# %f
when /%\*?f/
when /%\*?[efgEFG]/
[ '([-+]?((\d+(?>(?=[^\d.]|$)))|(\d*(\.(\d*([eE][-+]?\d+)?)))))', :extract_float ]
# %5f
when /%\*?(\d+)f/
when /%\*?(\d+)[efgEFG]/
[ "(\\S{1,#{$1}})", :extract_float ]
# %5s
@ -490,7 +490,7 @@ module Scanf
attr_reader :string_left, :last_spec_tried,
:last_match_tried, :matched_count, :space
SPECIFIERS = 'diuXxofeEgsc'
SPECIFIERS = 'diuXxofFeEgGsc'
REGEX = /
# possible space, followed by...
(?:\s*