summaryrefslogtreecommitdiff
path: root/lib/optparse.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-29 06:39:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-29 06:39:50 +0000
commit0977fe17053680310cb0611e9ad2df705d05a070 (patch)
tree193303ea0a80ff3afab2278ad36cb60b1353fe2a /lib/optparse.rb
parentfec60bc7c4f851d0cf1c4670ef8f2d9c597b7598 (diff)
* instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb,
lib/debug.rb, lib/getoptlong.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb lib/uri/common.rb: revert escape for `-' in character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r--lib/optparse.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index fcd6a881c5..dfda6b2595 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1346,14 +1346,14 @@ Default options, which never appear in option summary.
hex = 'x[\da-f]+(?:_[\da-f]+)*'
octal = "0(?:[0-7]*(?:_[0-7]+)*|#{binary}|#{hex})"
integer = "#{octal}|#{decimal}"
- accept(Integer, %r"\A[\-+]?(?:#{integer})"io) {|s| Integer(s) if s}
+ accept(Integer, %r"\A[-+]?(?:#{integer})"io) {|s| Integer(s) if s}
=begin
: Float
Float number format, and converts to (({Float})).
=end #'#"#`#
- float = "(?:#{decimal}(?:\\.(?:#{decimal})?)?|\\.#{decimal})(?:E[\\-+]?#{decimal})?"
- floatpat = %r"\A[\-+]?#{float}"io
+ float = "(?:#{decimal}(?:\\.(?:#{decimal})?)?|\\.#{decimal})(?:E[-+]?#{decimal})?"
+ floatpat = %r"\A[-+]?#{float}"io
accept(Float, floatpat) {|s| s.to_f if s}
=begin
@@ -1361,13 +1361,13 @@ Default options, which never appear in option summary.
Generic numeric format, and converts to (({Integer})) for integer
format, (({Float})) for float format.
=end #'#"#`#
- accept(Numeric, %r"\A[\-+]?(?:#{octal}|#{float})"io) {|s| eval(s) if s}
+ accept(Numeric, %r"\A[-+]?(?:#{octal}|#{float})"io) {|s| eval(s) if s}
=begin
: OptionParser::DecimalInteger
Decimal integer format, to be converted to (({Integer})).
=end #'#"#`#
- DecimalInteger = /\A[\-+]?#{decimal}/io
+ DecimalInteger = /\A[-+]?#{decimal}/io
accept(DecimalInteger) {|s| s.to_i if s}
=begin
@@ -1375,7 +1375,7 @@ Default options, which never appear in option summary.
Ruby/C like octal/hexadecimal/binary integer format, to be converted
to (({Integer})).
=end #'#"#`#
- OctalInteger = /\A[\-+]?(?:[0-7]+(?:_[0-7]+)*|0(?:#{binary}|#{hex}))/io
+ OctalInteger = /\A[-+]?(?:[0-7]+(?:_[0-7]+)*|0(?:#{binary}|#{hex}))/io
accept(OctalInteger) {|s| s.oct if s}
=begin