Skip to content

Commit 94b740b

Browse files
committed
Use Ripper for IRB
The debug option of IRB is deleted because it's just for IRB's pure Ruby parser.
1 parent 567cb1a commit 94b740b

File tree

8 files changed

+192
-1211
lines changed

8 files changed

+192
-1211
lines changed

doc/irb/irb.rd.ja

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
7070
--back-trace-limit n
7171
バックトレース表示をバックトレースの頭から n, 後ろ
7272
からnだけ行なう. デフォルトは16
73-
--irb_debug n irbのデバッグデバッグレベルをnに設定する(利用しな
74-
い方が無難でしょう).
7573
-v, --version irbのバージョンを表示する
7674

7775
= コンフィギュレーション
@@ -97,7 +95,6 @@ irb起動時に``~/.irbrc''を読み込みます. もし存在しない場合は
9795
IRB.conf[:IGNORE_EOF] = false
9896
IRB.conf[:PROMPT_MODE] = :DEFAULT
9997
IRB.conf[:PROMPT] = {...}
100-
IRB.conf[:DEBUG_LEVEL]=0
10198
IRB.conf[:VERBOSE]=true
10299

103100
== プロンプトの設定
@@ -183,9 +180,6 @@ irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両
183180
バックトレース表示をバックトレースの頭からn, 後ろからnだけ行なう.
184181
デフォルトは16
185182

186-
--- conf.debug_level = N
187-
irb用のデバッグレベルの設定
188-
189183
--- conf.ignore_eof = true/false
190184
^Dが入力された時の動作を設定する. trueの時は^Dを無視する, falseの
191185
時はirbを終了する.

lib/irb.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
# --back-trace-limit n
7575
# Display backtrace top n and tail n. The default
7676
# value is 16.
77-
# --irb_debug n Set internal debug level to n (not for popular use)
7877
# -v, --version Print the version of irb
7978
#
8079
# == Configuration
@@ -102,7 +101,6 @@
102101
# IRB.conf[:IGNORE_EOF] = false
103102
# IRB.conf[:PROMPT_MODE] = :DEFAULT
104103
# IRB.conf[:PROMPT] = {...}
105-
# IRB.conf[:DEBUG_LEVEL]=0
106104
#
107105
# === Auto indentation
108106
#
@@ -413,7 +411,6 @@ def initialize(workspace = nil, input_method = nil, output_method = nil)
413411
@signal_status = :IN_IRB
414412

415413
@scanner = RubyLex.new
416-
@scanner.exception_on_syntax_error = false
417414
end
418415

419416
def run(conf = IRB.conf)

lib/irb/context.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def initialize(irb, workspace = nil, input_method = nil, output_method = nil)
101101
if @echo.nil?
102102
@echo = true
103103
end
104-
self.debug_level = IRB.conf[:DEBUG_LEVEL]
105104
end
106105

107106
# The top-level workspace, see WorkSpace#main
@@ -211,10 +210,6 @@ def main
211210
#
212211
# A copy of the default <code>IRB.conf[:VERBOSE]</code>
213212
attr_accessor :verbose
214-
# The debug level of irb
215-
#
216-
# See #debug_level= for more information.
217-
attr_reader :debug_level
218213

219214
# The limit of backtrace lines displayed as top +n+ and tail +n+.
220215
#
@@ -361,21 +356,6 @@ def use_readline=(opt)
361356
print "Do nothing."
362357
end
363358

364-
# Sets the debug level of irb
365-
#
366-
# Can also be set using the +--irb_debug+ command line option.
367-
#
368-
# See IRB@Command+line+options for more command line options.
369-
def debug_level=(value)
370-
@debug_level = value
371-
RubyLex.debug_level = value
372-
end
373-
374-
# Whether or not debug mode is enabled, see #debug_level=.
375-
def debug?
376-
@debug_level > 0
377-
end
378-
379359
def evaluate(line, line_no, exception: nil) # :nodoc:
380360
@line_no = line_no
381361
if exception

lib/irb/init.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ def IRB.init_config(ap_path)
112112
@CONF[:LC_MESSAGES] = Locale.new
113113

114114
@CONF[:AT_EXIT] = []
115-
116-
@CONF[:DEBUG_LEVEL] = 0
117115
end
118116

119117
def IRB.init_error
@@ -191,8 +189,6 @@ def IRB.parse_opts(argv: ::ARGV)
191189
@CONF[:CONTEXT_MODE] = ($1 || argv.shift).to_i
192190
when "--single-irb"
193191
@CONF[:SINGLE_IRB] = true
194-
when /^--irb_debug(?:=(.+))?/
195-
@CONF[:DEBUG_LEVEL] = ($1 || argv.shift).to_i
196192
when "-v", "--version"
197193
print IRB.version, "\n"
198194
exit 0

lib/irb/lc/help-message

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Usage: irb.rb [options] [programfile] [arguments]
3939
--back-trace-limit n
4040
Display backtrace top n and tail n. The default
4141
value is 16.
42-
--irb_debug n Set internal debug level to n (not for popular use)
4342
--verbose Show details
4443
--noverbose Don't show details
4544
-v, --version Print the version of irb

lib/irb/lc/ja/help-message

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ Usage: irb.rb [options] [programfile] [arguments]
4141
バックトレース表示をバックトレースの頭から n, 後ろ
4242
からnだけ行なう. デフォルトは16
4343

44-
--irb_debug n irbのデバッグレベルをnに設定する(非推奨).
45-
4644
--verbose 詳細なメッセージを出力する.
4745
--noverbose 詳細なメッセージを出力しない(デフォルト).
4846
-v, --version irbのバージョンを表示する.

0 commit comments

Comments
 (0)