From 287a34ae0dfc23e4158f67cb7783d239f202c368 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2009 03:56:38 +0000 Subject: * {ext,lib,test}/**/*.rb: removed trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/cmd/chws.rb | 4 +- lib/irb/cmd/fork.rb | 6 +-- lib/irb/cmd/help.rb | 2 +- lib/irb/cmd/load.rb | 8 ++-- lib/irb/cmd/nop.rb | 6 +-- lib/irb/cmd/pushws.rb | 4 +- lib/irb/cmd/subirb.rb | 4 +- lib/irb/completion.rb | 26 ++++++------- lib/irb/context.rb | 12 +++--- lib/irb/ext/change-ws.rb | 10 ++--- lib/irb/ext/history.rb | 8 ++-- lib/irb/ext/loader.rb | 10 ++--- lib/irb/ext/math-mode.rb | 4 +- lib/irb/ext/multi-irb.rb | 12 +++--- lib/irb/ext/save-history.rb | 4 +- lib/irb/ext/tracer.rb | 8 ++-- lib/irb/ext/use-loader.rb | 6 +-- lib/irb/ext/workspaces.rb | 4 +- lib/irb/extend-command.rb | 16 ++++---- lib/irb/frame.rb | 4 +- lib/irb/help.rb | 2 +- lib/irb/init.rb | 8 ++-- lib/irb/input-method.rb | 12 +++--- lib/irb/lc/error.rb | 4 +- lib/irb/lc/ja/error.rb | 4 +- lib/irb/locale.rb | 10 ++--- lib/irb/notifier.rb | 14 +++---- lib/irb/output-method.rb | 6 +-- lib/irb/ruby-lex.rb | 90 ++++++++++++++++++++++----------------------- lib/irb/ruby-token.rb | 16 ++++---- lib/irb/slex.rb | 36 +++++++++--------- lib/irb/version.rb | 2 +- lib/irb/workspace.rb | 14 +++---- lib/irb/ws-for-case-2.rb | 4 +- lib/irb/xmp.rb | 2 +- 35 files changed, 191 insertions(+), 191 deletions(-) (limited to 'lib/irb') diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb index c2db7e5d91..e225b52585 100644 --- a/lib/irb/cmd/chws.rb +++ b/lib/irb/cmd/chws.rb @@ -1,12 +1,12 @@ # -# change-ws.rb - +# change-ws.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "irb/cmd/nop.rb" diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb index 6f4133c047..534f13f56a 100644 --- a/lib/irb/cmd/fork.rb +++ b/lib/irb/cmd/fork.rb @@ -1,12 +1,12 @@ # -# fork.rb - +# fork.rb - # $Release Version: 0.9.5 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # @RCS_ID='-$Id$-' @@ -17,7 +17,7 @@ module IRB class Fork @size end - + alias real_inspect inspect def inspect diff --git a/lib/irb/ext/loader.rb b/lib/irb/ext/loader.rb index 2d4400caef..cee8f51cc9 100644 --- a/lib/irb/ext/loader.rb +++ b/lib/irb/ext/loader.rb @@ -1,12 +1,12 @@ # -# loader.rb - +# loader.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # @@ -44,7 +44,7 @@ module IRB irb.suspend_name(path, File.basename(path)) do irb.suspend_input_method(FileInputMethod.new(path)) do |back_io| - irb.signal_status(:IN_LOAD) do + irb.signal_status(:IN_LOAD) do if back_io.kind_of?(FileInputMethod) irb.eval_input else @@ -61,7 +61,7 @@ module IRB def load_file(path, priv = nil) irb.suspend_name(path, File.basename(path)) do - + if priv ws = WorkSpace.new(Module.new) else @@ -70,7 +70,7 @@ module IRB irb.suspend_workspace(ws) do irb.suspend_input_method(FileInputMethod.new(path)) do |back_io| - irb.signal_status(:IN_LOAD) do + irb.signal_status(:IN_LOAD) do # p irb.conf if back_io.kind_of?(FileInputMethod) irb.eval_input diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb index 450a21eff7..370fab229d 100644 --- a/lib/irb/ext/math-mode.rb +++ b/lib/irb/ext/math-mode.rb @@ -1,12 +1,12 @@ # -# math-mode.rb - +# math-mode.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "mathn" diff --git a/lib/irb/ext/multi-irb.rb b/lib/irb/ext/multi-irb.rb index d32d41ff95..5085a3f272 100644 --- a/lib/irb/ext/multi-irb.rb +++ b/lib/irb/ext/multi-irb.rb @@ -6,7 +6,7 @@ # # -- # -# +# # IRB.fail CantShiftToMultiIrbMode unless defined?(Thread) require "thread" @@ -66,7 +66,7 @@ module IRB IRB.fail IrbAlreadyDead unless th.alive? th.exit end - end + end def search(key) job = case key @@ -123,8 +123,8 @@ module IRB t_status = "exited" end ary.push format("#%d->%s on %s (%s: %s)", - i, - irb.context.irb_name, + i, + irb.context.irb_name, irb.context.main, th, t_status) @@ -143,14 +143,14 @@ module IRB IRB.JobManager.irb(Thread.current).context end - # invoke multi-irb + # invoke multi-irb def IRB.irb(file = nil, *main) workspace = WorkSpace.new(*main) parent_thread = Thread.current Thread.start do begin irb = Irb.new(workspace, file) - rescue + rescue print "Subirb can't start with context(self): ", workspace.main.inspect, "\n" print "return to main irb\n" Thread.pass diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb index 88610fe9c9..4d53844d5f 100644 --- a/lib/irb/ext/save-history.rb +++ b/lib/irb/ext/save-history.rb @@ -1,13 +1,13 @@ #!/usr/local/bin/ruby # -# save-history.rb - +# save-history.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "readline" diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb index df954af20b..6728c46137 100644 --- a/lib/irb/ext/tracer.rb +++ b/lib/irb/ext/tracer.rb @@ -1,12 +1,12 @@ # -# irb/lib/tracer.rb - +# irb/lib/tracer.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "tracer" @@ -43,7 +43,7 @@ module IRB alias __evaluate__ evaluate def evaluate(context, statements, file = nil, line = nil) if context.use_tracer? && file != nil && line != nil - Tracer.on + Tracer.on begin __evaluate__(context, statements, file, line) ensure @@ -57,4 +57,4 @@ module IRB IRB.initialize_tracer end - + diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb index 3836275fcd..b643dd099e 100644 --- a/lib/irb/ext/use-loader.rb +++ b/lib/irb/ext/use-loader.rb @@ -1,12 +1,12 @@ # -# use-loader.rb - +# use-loader.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "irb/cmd/load" @@ -30,7 +30,7 @@ module IRB class Context IRB.conf[:USE_LOADER] = false - + def use_loader IRB.conf[:USE_LOADER] end diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb index f3ae8d1ae8..654b8118ea 100644 --- a/lib/irb/ext/workspaces.rb +++ b/lib/irb/ext/workspaces.rb @@ -1,12 +1,12 @@ # -# push-ws.rb - +# push-ws.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # module IRB diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb index 2816f35116..61a43e4a78 100644 --- a/lib/irb/extend-command.rb +++ b/lib/irb/extend-command.rb @@ -1,12 +1,12 @@ # -# irb/extend-command.rb - irb extend command +# irb/extend-command.rb - irb extend command # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # module IRB # @@ -89,15 +89,15 @@ module IRB [:irb_load, :Load, "irb/cmd/load"], [:irb_require, :Require, "irb/cmd/load"], - [:irb_source, :Source, "irb/cmd/load", + [:irb_source, :Source, "irb/cmd/load", [:source, NO_OVERRIDE]], [:irb, :IrbCommand, "irb/cmd/subirb"], - [:irb_jobs, :Jobs, "irb/cmd/subirb", + [:irb_jobs, :Jobs, "irb/cmd/subirb", [:jobs, NO_OVERRIDE]], - [:irb_fg, :Foreground, "irb/cmd/subirb", + [:irb_fg, :Foreground, "irb/cmd/subirb", [:fg, NO_OVERRIDE]], - [:irb_kill, :Kill, "irb/cmd/subirb", + [:irb_kill, :Kill, "irb/cmd/subirb", [:kill, OVERRIDE_PRIVATE_ONLY]], [:irb_help, :Help, "irb/cmd/help", @@ -161,9 +161,9 @@ module IRB (override == NO_OVERRIDE) && !respond_to?(to, true) target = self (class<(other) @level <=> other.level end - + def notify? @base_notifier.level >= self end diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb index 301af7210e..bbfc072536 100644 --- a/lib/irb/output-method.rb +++ b/lib/irb/output-method.rb @@ -1,12 +1,12 @@ # -# output-method.rb - optput methods used by irb +# output-method.rb - optput methods used by irb # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "e2mmap" @@ -39,7 +39,7 @@ module IRB # (\*|\*[1-9][0-9]*\$|[1-9][0-9]*) # .(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)? # #(hh|h|l|ll|L|q|j|z|t) - # [diouxXeEfgGcsb%] + # [diouxXeEfgGcsb%] def parse_printf_format(format, opts) return format, opts if $1.size % 2 == 1 end diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index b21f0d34f8..13b101ffc8 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -6,7 +6,7 @@ # # -- # -# +# # require "e2mmap" @@ -20,12 +20,12 @@ class RubyLex def_exception(:AlreadyDefinedToken, "Already defined token(%s)") def_exception(:TkReading2TokenNoKey, "key nothing(key='%s')") def_exception(:TkSymbol2TokenNoKey, "key nothing(key='%s')") - def_exception(:TkReading2TokenDuplicateError, + def_exception(:TkReading2TokenDuplicateError, "key duplicate(token_n='%s', key='%s')") def_exception(:SyntaxError, "%s") def_exception(:TerminateLineInput, "Terminate Line Input") - + include RubyToken class << self @@ -53,7 +53,7 @@ class RubyLex @lex_state = EXPR_BEG @space_seen = false @here_header = false - + @continue = false @line = "" @@ -91,7 +91,7 @@ class RubyLex else @base_char_no += @readed.size end - + readed = @readed.join("") @readed = [] readed @@ -111,7 +111,7 @@ class RubyLex end @seek += 1 if c == "\n" - @line_no += 1 + @line_no += 1 @char_no = 0 else @char_no += 1 @@ -148,10 +148,10 @@ class RubyLex c2 = @here_readed.pop end c = c2 unless c - @rests.unshift c #c = + @rests.unshift c #c = @seek -= 1 if c == "\n" - @line_no -= 1 + @line_no -= 1 if idx = @readed.reverse.index("\n") @char_no = @readed.size - idx else @@ -216,14 +216,14 @@ class RubyLex @lex_state = EXPR_BEG @space_seen = false @here_header = false - + @continue = false prompt @line = "" @exp_line_no = @line_no end - + def each_top_level_statement initialize_input catch(:TERM_INPUT) do @@ -297,7 +297,7 @@ class RubyLex # Tracer.off tk end - + ENINDENT_CLAUSE = [ "case", "class", "def", "do", "for", "if", "module", "unless", "until", "while", "begin" #, "when" @@ -314,7 +314,7 @@ class RubyLex "W" => "]", "s" => ":" } - + PERCENT_PAREN = { "{" => "}", "[" => "]", @@ -354,7 +354,7 @@ class RubyLex end @OP.def_rule("=begin", - proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do + proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do |op, io| @ltype = "=" until getc == "\n"; end @@ -374,8 +374,8 @@ class RubyLex else @continue = false @lex_state = EXPR_BEG - until (@indent_stack.empty? || - [TkLPAREN, TkLBRACK, TkLBRACE, + until (@indent_stack.empty? || + [TkLPAREN, TkLBRACK, TkLBRACE, TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last)) @indent_stack.pop end @@ -385,9 +385,9 @@ class RubyLex Token(TkNL) end - @OP.def_rules("*", "**", - "=", "==", "===", - "=~", "<=>", + @OP.def_rules("*", "**", + "=", "==", "===", + "=~", "<=>", "<", "<=", ">", ">=", ">>") do |op, io| @@ -455,7 +455,7 @@ class RubyLex @lex_state = EXPR_BEG; Token(TkQUESTION) else - if (ch == '\\') + if (ch == '\\') read_escape end @lex_state = EXPR_END @@ -469,8 +469,8 @@ class RubyLex @lex_state = EXPR_BEG Token(op) end - - @OP.def_rules("+=", "-=", "*=", "**=", + + @OP.def_rules("+=", "-=", "*=", "**=", "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do |op, io| @lex_state = EXPR_BEG @@ -529,7 +529,7 @@ class RubyLex lex_int2 end - + def lex_int2 @OP.def_rules("]", "}", ")") do |op, io| @@ -572,7 +572,7 @@ class RubyLex Token(TkOPASGN, "/") #/) elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/ identify_string(op) - else + else @lex_state = EXPR_BEG Token("/") #/) end @@ -588,7 +588,7 @@ class RubyLex # @lex_state = EXPR_BEG # Token(OP_ASGN, :^) # end - + @OP.def_rules(",") do |op, io| @lex_state = EXPR_BEG @@ -598,8 +598,8 @@ class RubyLex @OP.def_rules(";") do |op, io| @lex_state = EXPR_BEG - until (@indent_stack.empty? || - [TkLPAREN, TkLBRACK, TkLBRACE, + until (@indent_stack.empty? || + [TkLPAREN, TkLBRACK, TkLBRACE, TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last)) @indent_stack.pop end @@ -617,7 +617,7 @@ class RubyLex @lex_state = EXPR_BEG Token("~") end - + @OP.def_rule("(") do |op, io| @indent += 1 @@ -718,7 +718,7 @@ class RubyLex end end - # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do + # @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do # |op, io| # @indent += 1 # @lex_state = EXPR_FNAME @@ -739,13 +739,13 @@ class RubyLex printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug? t end - + p @OP if RubyLex.debug? end - + def identify_gvar @lex_state = EXPR_END - + case ch = getc when /[~_*$?!@\/\\;,=:<>".]/ #" Token(TkGVAR, "$" + ch) @@ -761,12 +761,12 @@ class RubyLex ungetc ungetc identify_identifier - else + else ungetc Token("$") end end - + def identify_identifier token = "" if peek(0) =~ /[$@]/ @@ -781,7 +781,7 @@ class RubyLex token.concat ch end ungetc - + if (ch == "!" || ch == "?") && token[0,1] =~ /\w/ && peek(0) != "=" token.concat getc end @@ -799,7 +799,7 @@ class RubyLex @lex_state = EXPR_END return Token(TkIVAR, token) end - + if @lex_state != EXPR_DOT print token, "\n" if RubyLex.debug? @@ -927,7 +927,7 @@ class RubyLex @lex_state = EXPR_END Token(Ltype2Token[lt]) end - + def identify_quotation ch = getc if lt = PERCENT_LTYPE[ch] @@ -968,10 +968,10 @@ class RubyLex match = /[0-7_]/ when /[89]/ RubyLex.fail SyntaxError, "Invalid octal digit" - else + else return Token(TkINTEGER) end - + len0 = true non_digit = false while ch = getc @@ -999,7 +999,7 @@ class RubyLex end return Token(TkINTEGER) end - + type = TkINTEGER allow_point = true allow_e = true @@ -1042,7 +1042,7 @@ class RubyLex end Token(type) end - + def identify_string(ltype, quoted = ltype) @ltype = ltype @quoted = quoted @@ -1063,7 +1063,7 @@ class RubyLex elsif ch == '\\' #' read_escape end - if PERCENT_PAREN.values.include?(@quoted) + if PERCENT_PAREN.values.include?(@quoted) if PERCENT_PAREN[ch] == @quoted nest += 1 elsif ch == @quoted @@ -1087,7 +1087,7 @@ class RubyLex @lex_state = EXPR_END end end - + def identify_comment @ltype = "#" @@ -1103,7 +1103,7 @@ class RubyLex end return Token(TkCOMMENT) end - + def read_escape case ch = getc when "\n", "\r", "\f" @@ -1120,7 +1120,7 @@ class RubyLex break end end - + when "x" 2.times do case ch = getc @@ -1149,7 +1149,7 @@ class RubyLex read_escape end else - # other characters + # other characters end end end diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb index 30a94b043c..9eb3bc1739 100644 --- a/lib/irb/ruby-token.rb +++ b/lib/irb/ruby-token.rb @@ -1,12 +1,12 @@ # -# irb/ruby-token.rb - ruby tokens +# irb/ruby-token.rb - ruby tokens # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # module RubyToken EXPR_BEG = :EXPR_BEG @@ -21,7 +21,7 @@ module RubyToken if !defined?(Symbol) Symbol = Integer end - + class Token def initialize(seek, line_no, char_no) @seek = seek @@ -84,7 +84,7 @@ module RubyToken if (tk = TkReading2Token[token]).nil? IRB.fail TkReading2TokenNoKey, token end - tk = Token(tk[0], value) + tk = Token(tk[0], value) if tk.kind_of?(TkOp) tk.name = token end @@ -93,8 +93,8 @@ module RubyToken if (tk = TkSymbol2Token[token]).nil? IRB.fail TkSymbol2TokenNoKey, token end - return Token(tk[0], value) - else + return Token(tk[0], value) + else if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty? token.new(@prev_seek, @prev_line_no, @prev_char_no) else @@ -194,7 +194,7 @@ module RubyToken [:TkASSOC, TkOp, "=>"], [:TkQUESTION, TkOp, "?"], #? [:TkCOLON, TkOp, ":"], #: - + [:TkfLPAREN], # func( # [:TkfLBRACK], # func[ # [:TkfLBRACE], # func{ # @@ -250,7 +250,7 @@ module RubyToken IRB.fail AlreadyDefinedToken, token_n end token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}") - + if reading if TkReading2Token[reading] IRB.fail TkReading2TokenDuplicateError, token_n, reading diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb index c8b40c6878..6b3d1f37e3 100644 --- a/lib/irb/slex.rb +++ b/lib/irb/slex.rb @@ -6,7 +6,7 @@ # # -- # -# +# # require "e2mmap" @@ -24,20 +24,20 @@ module IRB D_WARN = DOUT::def_notifier(1, "Warn: ") D_DEBUG = DOUT::def_notifier(2, "Debug: ") D_DETAIL = DOUT::def_notifier(4, "Detail: ") - + DOUT.level = Notifier::D_NOMSG def initialize @head = Node.new("") end - + def def_rule(token, preproc = nil, postproc = nil, &block) D_DETAIL.pp token postproc = block if block_given? node = create(token, preproc, postproc) end - + def def_rules(*tokens, &block) if block_given? p = block @@ -46,18 +46,18 @@ module IRB def_rule(token, nil, p) end end - + def preproc(token, proc) node = search(token) node.preproc=proc end - - #要チェック? + + #要チェック? def postproc(token) node = search(token, proc) node.postproc=proc end - + def search(token) @head.search(token.split(//)) end @@ -65,7 +65,7 @@ module IRB def create(token, preproc = nil, postproc = nil) @head.create_subnode(token.split(//), preproc, postproc) end - + def match(token) case token when Array @@ -78,14 +78,14 @@ module IRB D_DETAIL.exec_if{D_DEATIL.printf "match end: %s:%s\n", ret, token.inspect} ret end - + def inspect format("", @head.inspect) end #---------------------------------------------------------------------- # - # class Node - + # class Node - # #---------------------------------------------------------------------- class Node @@ -99,7 +99,7 @@ module IRB attr_accessor :preproc attr_accessor :postproc - + def search(chrs, opt = nil) return self if chrs.empty? ch = chrs.shift @@ -114,7 +114,7 @@ module IRB end end end - + def create_subnode(chrs, preproc = nil, postproc = nil) if chrs.empty? if @postproc @@ -127,7 +127,7 @@ module IRB end return self end - + ch = chrs.shift if node = @Tree[ch] if chrs.empty? @@ -161,7 +161,7 @@ module IRB # chrs: String # character array # io must have getc()/ungetc(); and ungetc() must be - # able to be called arbitrary number of times. + # able to be called arbitrary number of times. # def match(chrs, op = "") D_DETAIL.print "match>: ", chrs, "op:", op, "\n" @@ -254,14 +254,14 @@ if $0 == __FILE__ print "1: ", tr.inspect, "\n" tr.def_rule("==") {print "==\n"} print "2: ", tr.inspect, "\n" - + print "case 1:\n" print tr.match("="), "\n" print "case 2:\n" print tr.match("=="), "\n" print "case 3:\n" print tr.match("=>"), "\n" - + when "2" tr = SLex.new print "0: ", tr.inspect, "\n" @@ -269,7 +269,7 @@ if $0 == __FILE__ print "1: ", tr.inspect, "\n" tr.def_rule("==", proc{false}) {print "==\n"} print "2: ", tr.inspect, "\n" - + print "case 1:\n" print tr.match("="), "\n" print "case 2:\n" diff --git a/lib/irb/version.rb b/lib/irb/version.rb index 32ecf940cf..a9ccc1ce95 100644 --- a/lib/irb/version.rb +++ b/lib/irb/version.rb @@ -6,7 +6,7 @@ # # -- # -# +# # module IRB diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb index 7c95106c39..1b88914a84 100644 --- a/lib/irb/workspace.rb +++ b/lib/irb/workspace.rb @@ -1,12 +1,12 @@ # -# irb/workspace-binding.rb - +# irb/workspace-binding.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # module IRB class WorkSpace @@ -21,7 +21,7 @@ module IRB case IRB.conf[:CONTEXT_MODE] when 0 # binding in proc on TOPLEVEL_BINDING @binding = eval("proc{binding}.call", - TOPLEVEL_BINDING, + TOPLEVEL_BINDING, __FILE__, __LINE__) when 1 # binding in loaded file @@ -37,7 +37,7 @@ EOF when 2 # binding in loaded file(thread use) unless defined? BINDING_QUEUE require "thread" - + IRB.const_set("BINDING_QUEUE", SizedQueue.new(1)) Thread.abort_on_exception = true Thread.start do @@ -49,7 +49,7 @@ EOF when 3 # binging in function on TOPLEVEL_BINDING(default) @binding = eval("def irb_binding; binding; end; irb_binding", - TOPLEVEL_BINDING, + TOPLEVEL_BINDING, __FILE__, __LINE__ - 3) end @@ -63,7 +63,7 @@ EOF when Module @binding = eval("IRB.conf[:__MAIN__].module_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__) else - begin + begin @binding = eval("IRB.conf[:__MAIN__].instance_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__) rescue TypeError IRB.fail CantChangeBinding, @main.inspect @@ -79,7 +79,7 @@ EOF def evaluate(context, statements, file = __FILE__, line = __LINE__) eval(statements, @binding, file, line) end - + # error message manipulator def filter_backtrace(bt) case IRB.conf[:CONTEXT_MODE] diff --git a/lib/irb/ws-for-case-2.rb b/lib/irb/ws-for-case-2.rb index 24c5fd5aa8..d7db90c96b 100644 --- a/lib/irb/ws-for-case-2.rb +++ b/lib/irb/ws-for-case-2.rb @@ -1,12 +1,12 @@ # -# irb/ws-for-case-2.rb - +# irb/ws-for-case-2.rb - # $Release Version: 0.9.5$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # while true diff --git a/lib/irb/xmp.rb b/lib/irb/xmp.rb index af87b48887..1a58026f45 100644 --- a/lib/irb/xmp.rb +++ b/lib/irb/xmp.rb @@ -6,7 +6,7 @@ # # -- # -# +# # require "irb" -- cgit v1.2.3