Skip to content

Commit aad5b4d

Browse files
committed
Remove unused method/const of RubyLex
1 parent 1713699 commit aad5b4d

1 file changed

Lines changed: 0 additions & 53 deletions

File tree

lib/irb/ruby-lex.rb

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,6 @@
1111
module IRB
1212
# :stopdoc:
1313
class RubyLex
14-
ASSIGNMENT_NODE_TYPES = [
15-
# Local, instance, global, class, constant, instance, and index assignment:
16-
# "foo = bar",
17-
# "@foo = bar",
18-
# "$foo = bar",
19-
# "@@foo = bar",
20-
# "::Foo = bar",
21-
# "a::Foo = bar",
22-
# "Foo = bar"
23-
# "foo.bar = 1"
24-
# "foo[1] = bar"
25-
:assign,
26-
27-
# Operation assignment:
28-
# "foo += bar"
29-
# "foo -= bar"
30-
# "foo ||= bar"
31-
# "foo &&= bar"
32-
:opassign,
33-
34-
# Multiple assignment:
35-
# "foo, bar = 1, 2
36-
:massign,
37-
]
38-
39-
ERROR_TOKENS = [
40-
:on_parse_error,
41-
:compile_error,
42-
:on_assign_error,
43-
:on_alias_error,
44-
:on_class_name_error,
45-
:on_param_error
46-
]
47-
4814
LTYPE_TOKENS = %i[
4915
on_heredoc_beg on_tstring_beg
5016
on_regexp_beg on_symbeg on_backtick
@@ -79,25 +45,6 @@ def initialize
7945
end
8046
end
8147

82-
class << self
83-
def compile_with_errors_suppressed(code, line_no: 1)
84-
begin
85-
result = yield code, line_no
86-
rescue ArgumentError
87-
# Ruby can issue an error for the code if there is an
88-
# incomplete magic comment for encoding in it. Force an
89-
# expression with a new line before the code in this
90-
# case to prevent magic comment handling. To make sure
91-
# line numbers in the lexed code remain the same,
92-
# decrease the line number by one.
93-
code = ";\n#{code}"
94-
line_no -= 1
95-
result = yield code, line_no
96-
end
97-
result
98-
end
99-
end
100-
10148
def check_code_state(code, local_variables:)
10249
parse_lex_result = Prism.parse_lex(code, scopes: [local_variables])
10350

0 commit comments

Comments
 (0)