From e73a68ebc322516a42821f502d6d5de5bfa1eb47 Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 27 May 2019 02:59:21 +0900 Subject: [PATCH] Support op, cvar, iver, gvar and kw that follow on symbeg in IRB --- lib/irb/ruby-lex.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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