diff options
author | aycabta <aycabta@gmail.com> | 2019-05-27 02:59:21 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-27 02:59:21 +0900 |
commit | e73a68ebc322516a42821f502d6d5de5bfa1eb47 (patch) | |
tree | 0dafaa06f590532b0eb70528b4b4ebd07ec0b314 /lib/irb/ruby-lex.rb | |
parent | 122679136820afc663b854567afd16e49eae5a96 (diff) | |
download | ruby-e73a68ebc322516a42821f502d6d5de5bfa1eb47.tar.gz |
Support op, cvar, iver, gvar and kw that follow on symbeg in IRB
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r-- | lib/irb/ruby-lex.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index b2ed7b4b3f..ea2158b8b2 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -256,7 +256,8 @@ class RubyLex start_token << t end_type << :on_regexp_end when :on_symbeg - if (i + 1) < @tokens.size and @tokens[i + 1][1] != :on_ident and @tokens[i + 1][1] != :on_const + acceptable_single_tokens = %i{on_ident on_const on_op on_cvar on_ivar on_gvar on_kw} + if (i + 1) < @tokens.size and acceptable_single_tokens.all?{ |t| @tokens[i + 1][1] != t } start_token << t end_type << :on_tstring_end end |