* lib/irb.rb: removed commented-out code.
* lib/irb/**/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5afa23b4a4
commit
76515504d5
@ -1,3 +1,8 @@
|
|||||||
|
Sat Aug 9 11:02:07 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||||
|
|
||||||
|
* lib/irb.rb: removed commented-out code.
|
||||||
|
* lib/irb/**/*.rb: ditto.
|
||||||
|
|
||||||
Sat Aug 9 10:35:30 2014 Laurent Arnoud <laurent@spkdev.net>
|
Sat Aug 9 10:35:30 2014 Laurent Arnoud <laurent@spkdev.net>
|
||||||
|
|
||||||
* lib/cmath.rb: fixed indent. [fix GH-696]
|
* lib/cmath.rb: fixed indent. [fix GH-696]
|
||||||
|
@ -13,7 +13,6 @@ require "e2mmap"
|
|||||||
require "irb/init"
|
require "irb/init"
|
||||||
require "irb/context"
|
require "irb/context"
|
||||||
require "irb/extend-command"
|
require "irb/extend-command"
|
||||||
#require "irb/workspace"
|
|
||||||
|
|
||||||
require "irb/ruby-lex"
|
require "irb/ruby-lex"
|
||||||
require "irb/input-method"
|
require "irb/input-method"
|
||||||
@ -399,7 +398,6 @@ module IRB
|
|||||||
ensure
|
ensure
|
||||||
irb_at_exit
|
irb_at_exit
|
||||||
end
|
end
|
||||||
# print "\n"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calls each event hook of IRB.conf[:AT_EXIT] when the current session quits.
|
# Calls each event hook of IRB.conf[:AT_EXIT] when the current session quits.
|
||||||
|
@ -19,7 +19,6 @@ module IRB
|
|||||||
include IrbLoader
|
include IrbLoader
|
||||||
|
|
||||||
def execute(file_name, priv = nil)
|
def execute(file_name, priv = nil)
|
||||||
# return ruby_load(file_name) unless IRB.conf[:USE_LOADER]
|
|
||||||
return irb_load(file_name, priv)
|
return irb_load(file_name, priv)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -28,7 +27,6 @@ module IRB
|
|||||||
include IrbLoader
|
include IrbLoader
|
||||||
|
|
||||||
def execute(file_name)
|
def execute(file_name)
|
||||||
# return ruby_require(file_name) unless IRB.conf[:USE_LOADER]
|
|
||||||
|
|
||||||
rex = Regexp.new("#{Regexp.quote(file_name)}(\.o|\.rb)?")
|
rex = Regexp.new("#{Regexp.quote(file_name)}(\.o|\.rb)?")
|
||||||
return false if $".find{|f| f =~ rex}
|
return false if $".find{|f| f =~ rex}
|
||||||
|
@ -38,8 +38,6 @@ module IRB
|
|||||||
CompletionProc = proc { |input|
|
CompletionProc = proc { |input|
|
||||||
bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
|
bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
|
||||||
|
|
||||||
# puts "input: #{input}"
|
|
||||||
|
|
||||||
case input
|
case input
|
||||||
when /^((["'`]).*\2)\.([^.]*)$/
|
when /^((["'`]).*\2)\.([^.]*)$/
|
||||||
# String
|
# String
|
||||||
@ -90,7 +88,6 @@ module IRB
|
|||||||
candidates = Object.constants.collect{|m| m.to_s}
|
candidates = Object.constants.collect{|m| m.to_s}
|
||||||
candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
|
candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
|
||||||
|
|
||||||
# when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
|
|
||||||
when /^([A-Z].*)::([^:.]*)$/
|
when /^([A-Z].*)::([^:.]*)$/
|
||||||
# Constant or class methods
|
# Constant or class methods
|
||||||
receiver = $1
|
receiver = $1
|
||||||
@ -143,9 +140,6 @@ module IRB
|
|||||||
regmessage = Regexp.new(Regexp.quote($1))
|
regmessage = Regexp.new(Regexp.quote($1))
|
||||||
candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
|
candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
|
||||||
|
|
||||||
# when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
|
|
||||||
# when /^((\.?[^.]+)+)\.([^.]*)$/
|
|
||||||
# when /^([^."].*)\.([^.]*)$/
|
|
||||||
when /^([^."].*)(\.|::)([^.]*)$/
|
when /^([^."].*)(\.|::)([^.]*)$/
|
||||||
# variable.func or func.func
|
# variable.func or func.func
|
||||||
receiver = $1
|
receiver = $1
|
||||||
@ -228,7 +222,6 @@ module IRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
if Readline.respond_to?("basic_word_break_characters=")
|
if Readline.respond_to?("basic_word_break_characters=")
|
||||||
# Readline.basic_word_break_characters= " \t\n\"\\'`><=;|&{("
|
|
||||||
Readline.basic_word_break_characters= " \t\n`><=;|&{("
|
Readline.basic_word_break_characters= " \t\n`><=;|&{("
|
||||||
end
|
end
|
||||||
Readline.completion_append_character = nil
|
Readline.completion_append_character = nil
|
||||||
|
@ -30,7 +30,6 @@ module IRB
|
|||||||
@workspace = WorkSpace.new
|
@workspace = WorkSpace.new
|
||||||
end
|
end
|
||||||
@thread = Thread.current if defined? Thread
|
@thread = Thread.current if defined? Thread
|
||||||
# @irb_level = 0
|
|
||||||
|
|
||||||
# copy of default configuration
|
# copy of default configuration
|
||||||
@ap_name = IRB.conf[:AP_NAME]
|
@ap_name = IRB.conf[:AP_NAME]
|
||||||
@ -378,8 +377,6 @@ module IRB
|
|||||||
def evaluate(line, line_no) # :nodoc:
|
def evaluate(line, line_no) # :nodoc:
|
||||||
@line_no = line_no
|
@line_no = line_no
|
||||||
set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
|
set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
|
||||||
# @workspace.evaluate("_ = IRB.conf[:MAIN_CONTEXT]._")
|
|
||||||
# @_ = @workspace.evaluate(line, irb_path, line_no)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def inspect_last_value # :nodoc:
|
def inspect_last_value # :nodoc:
|
||||||
|
@ -40,30 +40,6 @@ module IRB # :nodoc:
|
|||||||
main.extend ExtendCommandBundle
|
main.extend ExtendCommandBundle
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# def change_binding(*_main)
|
|
||||||
# back = @workspace
|
|
||||||
# @workspace = WorkSpace.new(*_main)
|
|
||||||
# unless _main.empty?
|
|
||||||
# begin
|
|
||||||
# main.extend ExtendCommandBundle
|
|
||||||
# rescue
|
|
||||||
# print "can't change binding to: ", main.inspect, "\n"
|
|
||||||
# @workspace = back
|
|
||||||
# return nil
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# @irb_level += 1
|
|
||||||
# begin
|
|
||||||
# catch(:SU_EXIT) do
|
|
||||||
# @irb.eval_input
|
|
||||||
# end
|
|
||||||
# ensure
|
|
||||||
# @irb_level -= 1
|
|
||||||
# @workspace = back
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# alias change_workspace change_binding
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ module IRB # :nodoc:
|
|||||||
def set_last_value(value)
|
def set_last_value(value)
|
||||||
_set_last_value(value)
|
_set_last_value(value)
|
||||||
|
|
||||||
# @workspace.evaluate self, "_ = IRB.CurrentContext.last_value"
|
if @eval_history
|
||||||
if @eval_history #and !@eval_history_values.equal?(llv)
|
|
||||||
@eval_history_values.push @line_no, @last_value
|
@eval_history_values.push @line_no, @last_value
|
||||||
@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
|
@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
|
||||||
end
|
end
|
||||||
|
@ -82,7 +82,6 @@ module IRB # :nodoc:
|
|||||||
irb.suspend_input_method(FileInputMethod.new(path)) do
|
irb.suspend_input_method(FileInputMethod.new(path)) do
|
||||||
|back_io|
|
|back_io|
|
||||||
irb.signal_status(:IN_LOAD) do
|
irb.signal_status(:IN_LOAD) do
|
||||||
# p irb.conf
|
|
||||||
if back_io.kind_of?(FileInputMethod)
|
if back_io.kind_of?(FileInputMethod)
|
||||||
irb.eval_input
|
irb.eval_input
|
||||||
else
|
else
|
||||||
|
@ -17,7 +17,6 @@ module IRB
|
|||||||
|
|
||||||
# Creates a new JobManager object
|
# Creates a new JobManager object
|
||||||
def initialize
|
def initialize
|
||||||
# @jobs = [[thread, irb],...]
|
|
||||||
@jobs = []
|
@jobs = []
|
||||||
@current_job = nil
|
@current_job = nil
|
||||||
end
|
end
|
||||||
|
@ -59,23 +59,7 @@ module IRB
|
|||||||
module HistorySavingAbility # :nodoc:
|
module HistorySavingAbility # :nodoc:
|
||||||
include Readline
|
include Readline
|
||||||
|
|
||||||
# def HistorySavingAbility.create_finalizer
|
|
||||||
# proc do
|
|
||||||
# if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
|
|
||||||
# if hf = IRB.conf[:HISTORY_FILE]
|
|
||||||
# file = File.expand_path(hf)
|
|
||||||
# end
|
|
||||||
# file = IRB.rc_file("_history") unless file
|
|
||||||
# open(file, 'w' ) do |f|
|
|
||||||
# hist = HISTORY.to_a
|
|
||||||
# f.puts(hist[-num..-1] || hist)
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
def HistorySavingAbility.extended(obj)
|
def HistorySavingAbility.extended(obj)
|
||||||
# ObjectSpace.define_finalizer(obj, HistorySavingAbility.create_finalizer)
|
|
||||||
IRB.conf[:AT_EXIT].push proc{obj.save_history}
|
IRB.conf[:AT_EXIT].push proc{obj.save_history}
|
||||||
obj.load_history
|
obj.load_history
|
||||||
obj
|
obj
|
||||||
|
@ -49,28 +49,18 @@ module IRB # :nodoc:
|
|||||||
[:irb_print_working_workspace, OVERRIDE_ALL],
|
[:irb_print_working_workspace, OVERRIDE_ALL],
|
||||||
[:irb_cwws, OVERRIDE_ALL],
|
[:irb_cwws, OVERRIDE_ALL],
|
||||||
[:irb_pwws, OVERRIDE_ALL],
|
[:irb_pwws, OVERRIDE_ALL],
|
||||||
# [:irb_cww, OVERRIDE_ALL],
|
|
||||||
# [:irb_pww, OVERRIDE_ALL],
|
|
||||||
[:cwws, NO_OVERRIDE],
|
[:cwws, NO_OVERRIDE],
|
||||||
[:pwws, NO_OVERRIDE],
|
[:pwws, NO_OVERRIDE],
|
||||||
# [:cww, NO_OVERRIDE],
|
|
||||||
# [:pww, NO_OVERRIDE],
|
|
||||||
[:irb_current_working_binding, OVERRIDE_ALL],
|
[:irb_current_working_binding, OVERRIDE_ALL],
|
||||||
[:irb_print_working_binding, OVERRIDE_ALL],
|
[:irb_print_working_binding, OVERRIDE_ALL],
|
||||||
[:irb_cwb, OVERRIDE_ALL],
|
[:irb_cwb, OVERRIDE_ALL],
|
||||||
[:irb_pwb, OVERRIDE_ALL],
|
[:irb_pwb, OVERRIDE_ALL],
|
||||||
# [:cwb, NO_OVERRIDE],
|
|
||||||
# [:pwb, NO_OVERRIDE]
|
|
||||||
],
|
],
|
||||||
[:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
|
[:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
|
||||||
[:irb_chws, OVERRIDE_ALL],
|
[:irb_chws, OVERRIDE_ALL],
|
||||||
# [:irb_chw, OVERRIDE_ALL],
|
|
||||||
[:irb_cws, OVERRIDE_ALL],
|
[:irb_cws, OVERRIDE_ALL],
|
||||||
# [:irb_cw, OVERRIDE_ALL],
|
|
||||||
[:chws, NO_OVERRIDE],
|
[:chws, NO_OVERRIDE],
|
||||||
# [:chw, NO_OVERRIDE],
|
|
||||||
[:cws, NO_OVERRIDE],
|
[:cws, NO_OVERRIDE],
|
||||||
# [:cw, NO_OVERRIDE],
|
|
||||||
[:irb_change_binding, OVERRIDE_ALL],
|
[:irb_change_binding, OVERRIDE_ALL],
|
||||||
[:irb_cb, OVERRIDE_ALL],
|
[:irb_cb, OVERRIDE_ALL],
|
||||||
[:cb, NO_OVERRIDE]],
|
[:cb, NO_OVERRIDE]],
|
||||||
@ -81,17 +71,13 @@ module IRB # :nodoc:
|
|||||||
[:bindings, NO_OVERRIDE]],
|
[:bindings, NO_OVERRIDE]],
|
||||||
[:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
|
[:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
|
||||||
[:irb_pushws, OVERRIDE_ALL],
|
[:irb_pushws, OVERRIDE_ALL],
|
||||||
# [:irb_pushw, OVERRIDE_ALL],
|
|
||||||
[:pushws, NO_OVERRIDE],
|
[:pushws, NO_OVERRIDE],
|
||||||
# [:pushw, NO_OVERRIDE],
|
|
||||||
[:irb_push_binding, OVERRIDE_ALL],
|
[:irb_push_binding, OVERRIDE_ALL],
|
||||||
[:irb_pushb, OVERRIDE_ALL],
|
[:irb_pushb, OVERRIDE_ALL],
|
||||||
[:pushb, NO_OVERRIDE]],
|
[:pushb, NO_OVERRIDE]],
|
||||||
[:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
|
[:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
|
||||||
[:irb_popws, OVERRIDE_ALL],
|
[:irb_popws, OVERRIDE_ALL],
|
||||||
# [:irb_popw, OVERRIDE_ALL],
|
|
||||||
[:popws, NO_OVERRIDE],
|
[:popws, NO_OVERRIDE],
|
||||||
# [:popw, NO_OVERRIDE],
|
|
||||||
[:irb_pop_binding, OVERRIDE_ALL],
|
[:irb_pop_binding, OVERRIDE_ALL],
|
||||||
[:irb_popb, OVERRIDE_ALL],
|
[:irb_popb, OVERRIDE_ALL],
|
||||||
[:popb, NO_OVERRIDE]],
|
[:popb, NO_OVERRIDE]],
|
||||||
|
@ -88,7 +88,6 @@ module IRB # :nodoc:
|
|||||||
},
|
},
|
||||||
:INF_RUBY => {
|
:INF_RUBY => {
|
||||||
:PROMPT_I => "%N(%m):%03n:%i> ",
|
:PROMPT_I => "%N(%m):%03n:%i> ",
|
||||||
# :PROMPT_N => "%N(%m):%03n:%i> ",
|
|
||||||
:PROMPT_N => nil,
|
:PROMPT_N => nil,
|
||||||
:PROMPT_S => nil,
|
:PROMPT_S => nil,
|
||||||
:PROMPT_C => nil,
|
:PROMPT_C => nil,
|
||||||
@ -110,7 +109,6 @@ module IRB # :nodoc:
|
|||||||
@CONF[:CONTEXT_MODE] = 3 # use binding in function on TOPLEVEL_BINDING
|
@CONF[:CONTEXT_MODE] = 3 # use binding in function on TOPLEVEL_BINDING
|
||||||
@CONF[:SINGLE_IRB] = false
|
@CONF[:SINGLE_IRB] = false
|
||||||
|
|
||||||
# @CONF[:LC_MESSAGES] = "en"
|
|
||||||
@CONF[:LC_MESSAGES] = Locale.new
|
@CONF[:LC_MESSAGES] = Locale.new
|
||||||
|
|
||||||
@CONF[:AT_EXIT] = []
|
@CONF[:AT_EXIT] = []
|
||||||
|
@ -117,7 +117,6 @@ module IRB
|
|||||||
def gets
|
def gets
|
||||||
print @prompt
|
print @prompt
|
||||||
l = @io.gets
|
l = @io.gets
|
||||||
# print @prompt, l
|
|
||||||
l
|
l
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -61,20 +61,6 @@ module IRB # :nodoc:
|
|||||||
# Inspector.def_inspector(key, inspector)
|
# Inspector.def_inspector(key, inspector)
|
||||||
# Inspector.def_inspector([key1,...], inspector)
|
# Inspector.def_inspector([key1,...], inspector)
|
||||||
def self.def_inspector(key, arg=nil, &block)
|
def self.def_inspector(key, arg=nil, &block)
|
||||||
# if !block_given?
|
|
||||||
# case arg
|
|
||||||
# when nil, Proc
|
|
||||||
# inspector = IRB::Inspector(init_p)
|
|
||||||
# when Inspector
|
|
||||||
# inspector = init_p
|
|
||||||
# else
|
|
||||||
# IRB.Raise IllegalParameter, init_p
|
|
||||||
# end
|
|
||||||
# init_p = nil
|
|
||||||
# else
|
|
||||||
# inspector = IRB::Inspector(block, init_p)
|
|
||||||
# end
|
|
||||||
|
|
||||||
if block_given?
|
if block_given?
|
||||||
inspector = IRB::Inspector(block, arg)
|
inspector = IRB::Inspector(block, arg)
|
||||||
else
|
else
|
||||||
|
@ -101,7 +101,6 @@ class RubyLex
|
|||||||
|
|
||||||
def getc
|
def getc
|
||||||
while @rests.empty?
|
while @rests.empty?
|
||||||
# return nil unless buf_input
|
|
||||||
@rests.push nil unless buf_input
|
@rests.push nil unless buf_input
|
||||||
end
|
end
|
||||||
c = @rests.shift
|
c = @rests.shift
|
||||||
@ -266,12 +265,8 @@ class RubyLex
|
|||||||
until (((tk = token).kind_of?(TkNL) || tk.kind_of?(TkEND_OF_SCRIPT)) &&
|
until (((tk = token).kind_of?(TkNL) || tk.kind_of?(TkEND_OF_SCRIPT)) &&
|
||||||
!@continue or
|
!@continue or
|
||||||
tk.nil?)
|
tk.nil?)
|
||||||
#p tk
|
|
||||||
#p @lex_state
|
|
||||||
#p self
|
|
||||||
end
|
end
|
||||||
line = get_readed
|
line = get_readed
|
||||||
# print self.inspect
|
|
||||||
if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
|
if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
@ -280,8 +275,6 @@ class RubyLex
|
|||||||
end
|
end
|
||||||
|
|
||||||
def token
|
def token
|
||||||
# require "tracer"
|
|
||||||
# Tracer.on
|
|
||||||
@prev_seek = @seek
|
@prev_seek = @seek
|
||||||
@prev_line_no = @line_no
|
@prev_line_no = @line_no
|
||||||
@prev_char_no = @char_no
|
@prev_char_no = @char_no
|
||||||
@ -299,15 +292,14 @@ class RubyLex
|
|||||||
if @readed_auto_clean_up
|
if @readed_auto_clean_up
|
||||||
get_readed
|
get_readed
|
||||||
end
|
end
|
||||||
# Tracer.off
|
|
||||||
tk
|
tk
|
||||||
end
|
end
|
||||||
|
|
||||||
ENINDENT_CLAUSE = [
|
ENINDENT_CLAUSE = [
|
||||||
"case", "class", "def", "do", "for", "if",
|
"case", "class", "def", "do", "for", "if",
|
||||||
"module", "unless", "until", "while", "begin" #, "when"
|
"module", "unless", "until", "while", "begin"
|
||||||
]
|
]
|
||||||
DEINDENT_CLAUSE = ["end" #, "when"
|
DEINDENT_CLAUSE = ["end"
|
||||||
]
|
]
|
||||||
|
|
||||||
PERCENT_LTYPE = {
|
PERCENT_LTYPE = {
|
||||||
@ -554,7 +546,6 @@ class RubyLex
|
|||||||
|
|
||||||
@OP.def_rule("::") do
|
@OP.def_rule("::") do
|
||||||
|op, io|
|
|op, io|
|
||||||
# p @lex_state.id2name, @space_seen
|
|
||||||
if @lex_state == EXPR_BEG or @lex_state == EXPR_ARG && @space_seen
|
if @lex_state == EXPR_BEG or @lex_state == EXPR_ARG && @space_seen
|
||||||
@lex_state = EXPR_BEG
|
@lex_state = EXPR_BEG
|
||||||
Token(TkCOLON3)
|
Token(TkCOLON3)
|
||||||
@ -586,11 +577,6 @@ class RubyLex
|
|||||||
Token("^")
|
Token("^")
|
||||||
end
|
end
|
||||||
|
|
||||||
# @OP.def_rules("^=") do
|
|
||||||
# @lex_state = EXPR_BEG
|
|
||||||
# Token(OP_ASGN, :^)
|
|
||||||
# end
|
|
||||||
|
|
||||||
@OP.def_rules(",") do
|
@OP.def_rules(",") do
|
||||||
|op, io|
|
|op, io|
|
||||||
@lex_state = EXPR_BEG
|
@lex_state = EXPR_BEG
|
||||||
@ -720,16 +706,6 @@ class RubyLex
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
|
|
||||||
# |op, io|
|
|
||||||
# @indent += 1
|
|
||||||
# @lex_state = EXPR_FNAME
|
|
||||||
# # @lex_state = EXPR_END
|
|
||||||
# # until @rests[0] == "\n" or @rests[0] == ";"
|
|
||||||
# # rests.shift
|
|
||||||
# # end
|
|
||||||
# end
|
|
||||||
|
|
||||||
@OP.def_rule("") do
|
@OP.def_rule("") do
|
||||||
|op, io|
|
|op, io|
|
||||||
printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug?
|
printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug?
|
||||||
@ -842,7 +818,6 @@ class RubyLex
|
|||||||
@indent += 1
|
@indent += 1
|
||||||
@indent_stack.push token_c
|
@indent_stack.push token_c
|
||||||
end
|
end
|
||||||
# p @indent_stack
|
|
||||||
end
|
end
|
||||||
|
|
||||||
elsif DEINDENT_CLAUSE.include?(token)
|
elsif DEINDENT_CLAUSE.include?(token)
|
||||||
@ -880,7 +855,6 @@ class RubyLex
|
|||||||
|
|
||||||
def identify_here_document
|
def identify_here_document
|
||||||
ch = getc
|
ch = getc
|
||||||
# if lt = PERCENT_LTYPE[ch]
|
|
||||||
if ch == "-"
|
if ch == "-"
|
||||||
ch = getc
|
ch = getc
|
||||||
indent = true
|
indent = true
|
||||||
@ -912,12 +886,6 @@ class RubyLex
|
|||||||
end
|
end
|
||||||
|
|
||||||
@here_header = false
|
@here_header = false
|
||||||
# while l = gets
|
|
||||||
# l = l.sub(/(:?\r)?\n\z/, '')
|
|
||||||
# if (indent ? l.strip : l) == quoted
|
|
||||||
# break
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
line = ""
|
line = ""
|
||||||
while ch = getc
|
while ch = getc
|
||||||
@ -954,11 +922,6 @@ class RubyLex
|
|||||||
else
|
else
|
||||||
RubyLex.fail SyntaxError, "unknown type of %string"
|
RubyLex.fail SyntaxError, "unknown type of %string"
|
||||||
end
|
end
|
||||||
# if ch !~ /\W/
|
|
||||||
# ungetc
|
|
||||||
# next
|
|
||||||
# end
|
|
||||||
#@ltype = lt
|
|
||||||
@quoted = ch unless @quoted = PERCENT_PAREN[ch]
|
@quoted = ch unless @quoted = PERCENT_PAREN[ch]
|
||||||
identify_string(lt, @quoted)
|
identify_string(lt, @quoted)
|
||||||
end
|
end
|
||||||
@ -1147,9 +1110,6 @@ class RubyLex
|
|||||||
@ltype = "#"
|
@ltype = "#"
|
||||||
|
|
||||||
while ch = getc
|
while ch = getc
|
||||||
# if ch == "\\" #"
|
|
||||||
# read_escape
|
|
||||||
# end
|
|
||||||
if ch == "\n"
|
if ch == "\n"
|
||||||
@ltype = nil
|
@ltype = nil
|
||||||
ungetc
|
ungetc
|
||||||
|
@ -186,7 +186,6 @@ module RubyToken
|
|||||||
[:TkRSHFT, TkOp, ">>"],
|
[:TkRSHFT, TkOp, ">>"],
|
||||||
[:TkCOLON2, TkOp],
|
[:TkCOLON2, TkOp],
|
||||||
[:TkCOLON3, TkOp],
|
[:TkCOLON3, TkOp],
|
||||||
# [:OPASGN, TkOp], # +=, -= etc. #
|
|
||||||
[:TkASSOC, TkOp, "=>"],
|
[:TkASSOC, TkOp, "=>"],
|
||||||
[:TkQUESTION, TkOp, "?"], #?
|
[:TkQUESTION, TkOp, "?"], #?
|
||||||
[:TkCOLON, TkOp, ":"], #:
|
[:TkCOLON, TkOp, ":"], #:
|
||||||
|
@ -247,7 +247,6 @@ end
|
|||||||
# :startdoc:
|
# :startdoc:
|
||||||
|
|
||||||
if $0 == __FILE__
|
if $0 == __FILE__
|
||||||
# Tracer.on
|
|
||||||
case $1
|
case $1
|
||||||
when "1"
|
when "1"
|
||||||
tr = SLex.new
|
tr = SLex.new
|
||||||
@ -281,4 +280,3 @@ if $0 == __FILE__
|
|||||||
end
|
end
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -54,8 +54,6 @@ class XMP
|
|||||||
# full detail.
|
# full detail.
|
||||||
def initialize(bind = nil)
|
def initialize(bind = nil)
|
||||||
IRB.init_config(nil)
|
IRB.init_config(nil)
|
||||||
#IRB.parse_opts
|
|
||||||
#IRB.load_modules
|
|
||||||
|
|
||||||
IRB.conf[:PROMPT_MODE] = :XMP
|
IRB.conf[:PROMPT_MODE] = :XMP
|
||||||
|
|
||||||
@ -65,7 +63,6 @@ class XMP
|
|||||||
@irb = IRB::Irb.new(ws, @io)
|
@irb = IRB::Irb.new(ws, @io)
|
||||||
@irb.context.ignore_sigint = false
|
@irb.context.ignore_sigint = false
|
||||||
|
|
||||||
# IRB.conf[:IRB_RC].call(@irb.context) if IRB.conf[:IRB_RC]
|
|
||||||
IRB.conf[:MAIN_CONTEXT] = @irb.context
|
IRB.conf[:MAIN_CONTEXT] = @irb.context
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user