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 /ext/tk | |
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 'ext/tk')
-rw-r--r-- | ext/tk/lib/tk.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index c24d6150aa..ab7fcc4b39 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -605,7 +605,7 @@ module TkCore end def rb_appsend(interp, async, *args) - args = args.collect!{|c| _get_eval_string(c).gsub(/[\]\[$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"]/, '\\\\\&')} args.push(').to_s"') appsend(interp, async, 'ruby "(', *args) end @@ -620,7 +620,7 @@ module TkCore end def rb_appsend_displayof(interp, win, async, *args) - args = args.collect!{|c| _get_eval_string(c).gsub(/[\]\[$"]/, '\\\\\&')} + args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"]/, '\\\\\&')} args.push(').to_s"') appsend_displayof(interp, win, async, 'ruby "(', *args) end @@ -1179,14 +1179,14 @@ class TkVariable elsif val.kind_of?(Array) a = [] val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))} - s = '"' + a.join(" ").gsub(/[\]\[$"]/, '\\\\\&') + '"' + s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; array set %s %s', @id, @id, s)) elsif val.kind_of?(Hash) s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ - .gsub(/[\]\[$"]/, '\\\\\&') + '"' + .gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; array set %s %s', @id, @id, s)) else - s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' + s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; set %s %s', @id, @id, s)) end end @@ -1214,7 +1214,7 @@ class TkVariable def value=(val) begin - s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' + s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; set %s %s', @id, @id, s)) rescue if INTERP._eval(format('global %s; array exists %s', @id, @id)) != "1" @@ -1226,12 +1226,12 @@ class TkVariable elsif val.kind_of?(Array) a = [] val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))} - s = '"' + a.join(" ").gsub(/[\]\[$"]/, '\\\\\&') + '"' + s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) elsif val.kind_of?(Hash) s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ - .gsub(/[\]\[$"]/, '\\\\\&') + '"' + .gsub(/[\[\]$"]/, '\\\\\&') + '"' INTERP._eval(format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) else @@ -1438,7 +1438,7 @@ class TkVarAccess<TkVariable def initialize(varname, val=nil) @id = varname if val - s = '"' + _get_eval_string(val).gsub(/[\]\[$"]/, '\\\\\&') + '"' #" + s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"' #" INTERP._eval(format('global %s; set %s %s', @id, @id, s)) end end |