* 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
This commit is contained in:
parent
8f4d0c4526
commit
7b34c2f81a
@ -1,3 +1,8 @@
|
|||||||
|
Thu Dec 27 23:27:15 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
|
||||||
|
|
||||||
|
* lib/irb/ruby-lex.rb: make lex_state to EXPR_END when next token
|
||||||
|
is an operator after SYMBEG [Bug #6378].
|
||||||
|
|
||||||
Thu Dec 27 21:30:21 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
|
Thu Dec 27 21:30:21 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
|
||||||
|
|
||||||
* lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
|
* lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
|
||||||
|
@ -54,6 +54,7 @@ class RubyLex
|
|||||||
@lex_state = EXPR_BEG
|
@lex_state = EXPR_BEG
|
||||||
@space_seen = false
|
@space_seen = false
|
||||||
@here_header = false
|
@here_header = false
|
||||||
|
@post_symbeg = false
|
||||||
|
|
||||||
@continue = false
|
@continue = false
|
||||||
@line = ""
|
@line = ""
|
||||||
@ -218,6 +219,8 @@ class RubyLex
|
|||||||
@here_header = false
|
@here_header = false
|
||||||
|
|
||||||
@continue = false
|
@continue = false
|
||||||
|
@post_symbeg = false
|
||||||
|
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
@line = ""
|
@line = ""
|
||||||
@ -286,6 +289,8 @@ class RubyLex
|
|||||||
begin
|
begin
|
||||||
tk = @OP.match(self)
|
tk = @OP.match(self)
|
||||||
@space_seen = tk.kind_of?(TkSPACE)
|
@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
|
rescue SyntaxError
|
||||||
raise if @exception_on_syntax_error
|
raise if @exception_on_syntax_error
|
||||||
tk = TkError.new(@seek, @line_no, @char_no)
|
tk = TkError.new(@seek, @line_no, @char_no)
|
||||||
@ -542,7 +547,7 @@ class RubyLex
|
|||||||
@lex_state = EXPR_BEG
|
@lex_state = EXPR_BEG
|
||||||
Token(TkCOLON)
|
Token(TkCOLON)
|
||||||
else
|
else
|
||||||
@lex_state = EXPR_FNAME;
|
@lex_state = EXPR_FNAME
|
||||||
Token(TkSYMBEG)
|
Token(TkSYMBEG)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user