summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorst0012 <stan001212@gmail.com>2022-09-30 23:18:19 +0100
committergit <svn-admin@ruby-lang.org>2022-10-03 04:59:51 +0900
commit5cab9d0ee2b728fe7c76ba303335d3b60bcb00b6 (patch)
tree999e858aeeb166242f61f85dc3445c49c79a77f1 /lib
parent42fcbcc2150c7eaa2057a159ede35a3ac046ea31 (diff)
downloadruby-5cab9d0ee2b728fe7c76ba303335d3b60bcb00b6.tar.gz
[ruby/irb] Remove patches for Ruby 2.4
They were added in https://github.com/ruby/irb/commit/b34f26a0dd3b589e6fc321a6248d173682c9202f https://github.com/ruby/irb/commit/0e760d2674
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/ruby-lex.rb31
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 3cb09fff55..8f629331db 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -297,7 +297,7 @@ class RubyLex
return true
elsif tokens.size >= 1 and tokens[-1].event == :on_heredoc_end # "EOH\n"
return false
- elsif tokens.size >= 2 and defined?(Ripper::EXPR_BEG) and tokens[-2].state.anybits?(Ripper::EXPR_BEG | Ripper::EXPR_FNAME) and tokens[-2].tok !~ /\A\.\.\.?\z/
+ elsif tokens.size >= 2 and tokens[-2].state.anybits?(Ripper::EXPR_BEG | Ripper::EXPR_FNAME) and tokens[-2].tok !~ /\A\.\.\.?\z/
# end of literal except for regexp
# endless range at end of line is not a continue
return true
@@ -378,21 +378,20 @@ class RubyLex
$VERBOSE = verbose
end
- if defined?(Ripper::EXPR_BEG)
- last_lex_state = tokens.last.state
- if last_lex_state.allbits?(Ripper::EXPR_BEG)
- return false
- elsif last_lex_state.allbits?(Ripper::EXPR_DOT)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_CLASS)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_FNAME)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_VALUE)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_ARG)
- return false
- end
+ last_lex_state = tokens.last.state
+
+ if last_lex_state.allbits?(Ripper::EXPR_BEG)
+ return false
+ elsif last_lex_state.allbits?(Ripper::EXPR_DOT)
+ return true
+ elsif last_lex_state.allbits?(Ripper::EXPR_CLASS)
+ return true
+ elsif last_lex_state.allbits?(Ripper::EXPR_FNAME)
+ return true
+ elsif last_lex_state.allbits?(Ripper::EXPR_VALUE)
+ return true
+ elsif last_lex_state.allbits?(Ripper::EXPR_ARG)
+ return false
end
false