* lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
[fix GH-1127] Patch by @koic git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b1a658e827
commit
6f04ae5688
@ -1,3 +1,8 @@
|
|||||||
|
Fri Dec 18 10:24:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
|
||||||
|
[fix GH-1127] Patch by @koic
|
||||||
|
|
||||||
Fri Dec 18 09:44:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
Fri Dec 18 09:44:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||||
|
|
||||||
* ext/pty/pty.c: fix double words typo.
|
* ext/pty/pty.c: fix double words typo.
|
||||||
|
@ -406,7 +406,7 @@ class RubyLex
|
|||||||
if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
|
if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
|
||||||
(@lex_state != EXPR_ARG || @space_seen)
|
(@lex_state != EXPR_ARG || @space_seen)
|
||||||
c = peek(0)
|
c = peek(0)
|
||||||
if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-")
|
if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-" || c == "~")
|
||||||
tk = identify_here_document
|
tk = identify_here_document
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -855,7 +855,7 @@ class RubyLex
|
|||||||
|
|
||||||
def identify_here_document
|
def identify_here_document
|
||||||
ch = getc
|
ch = getc
|
||||||
if ch == "-"
|
if ch == "-" || ch == "~"
|
||||||
ch = getc
|
ch = getc
|
||||||
indent = true
|
indent = true
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user