diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-22 04:31:24 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-22 04:31:24 +0000 |
commit | e689d077e30d4680af140be5549a369590e3db39 (patch) | |
tree | fe6bc16aecb02d55f2c8501d4840418566a2e8ea /lib | |
parent | 9b3344c94d527d58886c5774f77d3cec01e472d1 (diff) |
* lib/optparse.rb, lib/jcode.rb, ext/tk/lib/tk.rb: reorder character
class /[\]\[]/ to /[\[\]]/ to readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jcode.rb | 2 | ||||
-rw-r--r-- | lib/optparse.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb index df2cd61b3f..1e8fd64518 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -9,7 +9,7 @@ class String printf STDERR, "feel free for some warnings:\n" if $VERBOSE def _regex_quote(str) - str.gsub(/(\\[\]\[\-\\])|\\(.)|([\]\[\\])/) do + str.gsub(/(\\[\[\]\-\\])|\\(.)|([\[\]\\])/) do $1 || $2 || '\\' + $3 end end diff --git a/lib/optparse.rb b/lib/optparse.rb index 1da5ef2cc0..ea1ba61356 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -965,7 +965,7 @@ Default options, which never appear in option summary. raise ArgumentError, "unsupported argument type: #{o}" when *ArgumentStyle.keys style = notwice(ArgumentStyle[o], style, 'style') - when /^--no-([^\]\[=\s]*)(.+)?/ + when /^--no-([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') not_pattern, not_conv = search(:atype, o) unless not_style @@ -975,7 +975,7 @@ Default options, which never appear in option summary. ldesc << "--no-#{q}" long << 'no-' + (q = q.downcase) nolong << q - when /^--\[no-\]([^\]\[=\s]*)(.+)?/ + when /^--\[no-\]([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') if a @@ -987,7 +987,7 @@ Default options, which never appear in option summary. not_pattern, not_conv = search(:atype, FalseClass) unless not_style not_style = Switch::NoArgument nolong << 'no-' + o - when /^--([^\]\[=\s]*)(.+)?/ + when /^--([^\[\]=\s]*)(.+)?/ q, a = $1, $2 if a o = notwice(NilClass, klass, 'type') |