Skip to content

Commit

Permalink
Revert "Treat :@1, :@@1, @1, and @@1 correctly to check termination"
Browse files Browse the repository at this point in the history
This reverts commit 5e275dd.

...The @1 type numberd parameter is reverted from Ruby syntax.
  • Loading branch information
aycabta committed Nov 29, 2019
1 parent bbbe481 commit c4686b9
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lib/irb/ruby-lex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,6 @@ def process_continue
return false
elsif @tokens.size >= 2 and @tokens[-2][1] == :on_kw and ['begin', 'else', 'ensure'].include?(@tokens[-2][2])
return false
elsif @tokens.size >= 3 and @tokens[-3][1] == :on_symbeg and @tokens[-2][1] == :on_ivar
# This is for :@a or :@1 because :@1 ends with EXPR_FNAME
return false
elsif @tokens.size >= 2 and @tokens[-2][1] == :on_ivar and @tokens[-2][2] =~ /\A@\d+\z/
# This is for @1
return false
elsif @tokens.size >= 2 and @tokens[-2][1] == :on_cvar and @tokens[-1][1] == :on_int
# This is for @@1 or :@@1 and ends with on_int because it's syntax error
return false
elsif !@tokens.empty? and @tokens.last[2] == "\\\n"
return true
elsif @tokens.size >= 1 and @tokens[-1][1] == :on_heredoc_end # "EOH\n"
Expand Down Expand Up @@ -265,12 +256,6 @@ def check_code_block(code)
# example:
# method / f /
return false
when /numbered parameter outside block/
# "numbered parameter outside block"
#
# example:
# :@1
return false
end
ensure
$VERBOSE = verbose
Expand Down

0 comments on commit c4686b9

Please sign in to comment.