aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb
diff options
context:
space:
mode:
authorkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-27 14:48:42 +0000
committerkeiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-27 14:48:42 +0000
commit7b34c2f81aa300aa943479077c7c19c472b0c71c (patch)
tree4d250a002312f46cdecef8ddc2fe5bcd5adaa0c5 /lib/irb
parent8f4d0c4526d38eac768c5d8517feb3a003b3d45c (diff)
downloadruby-7b34c2f81aa300aa943479077c7c19c472b0c71c.tar.gz
* lib/irb/ruby-lex.rb: make lex_state to EXPR_END when next token
is an operator after SYMBEG [Bug #6378]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb')
-rw-r--r--lib/irb/ruby-lex.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 19b7b9198b..4a700b3324 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -54,6 +54,7 @@ class RubyLex
@lex_state = EXPR_BEG
@space_seen = false
@here_header = false
+ @post_symbeg = false
@continue = false
@line = ""
@@ -218,6 +219,8 @@ class RubyLex
@here_header = false
@continue = false
+ @post_symbeg = false
+
prompt
@line = ""
@@ -286,6 +289,8 @@ class RubyLex
begin
tk = @OP.match(self)
@space_seen = tk.kind_of?(TkSPACE)
+ @lex_state = EXPR_END if @post_symbeg && tk.kind_of?(TkOp)
+ @post_symbeg = tk.kind_of?(TkSYMBEG)
rescue SyntaxError
raise if @exception_on_syntax_error
tk = TkError.new(@seek, @line_no, @char_no)
@@ -542,7 +547,7 @@ class RubyLex
@lex_state = EXPR_BEG
Token(TkCOLON)
else
- @lex_state = EXPR_FNAME;
+ @lex_state = EXPR_FNAME
Token(TkSYMBEG)
end
end