diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-26 23:26:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-26 23:26:03 +0000 |
commit | 36208390a90c2e1e0f4a58f2362f6183c7892836 (patch) | |
tree | 29989d6175d078dd35462a58c29efabc3d22344e /parse.y | |
parent | e64b2e4131677b76b83542bb9d1f38180bf4caaa (diff) | |
download | ruby-36208390a90c2e1e0f4a58f2362f6183c7892836.tar.gz |
parse.y: heredoc token
* parse.y (parser_heredoc_identifier): gather branches by quote
char.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6401,6 +6401,7 @@ static int parser_heredoc_identifier(struct parser_params *parser) { int c = nextc(), term, func = 0; + int token = tSTRING_BEG; long len; if (c == '-') { @@ -6419,7 +6420,9 @@ parser_heredoc_identifier(struct parser_params *parser) case '"': func |= str_dquote; goto quoted; case '`': - func |= str_xquote; + token = tXSTRING_BEG; + func |= str_xquote; goto quoted; + quoted: newtok(); tokadd(func); @@ -6442,7 +6445,6 @@ parser_heredoc_identifier(struct parser_params *parser) return 0; } newtok(); - term = '"'; tokadd(func |= str_dquote); do { if (tokadd_mbchar(c) == -1) return 0; @@ -6461,7 +6463,7 @@ parser_heredoc_identifier(struct parser_params *parser) lex_lastline); /* nd_orig */ nd_set_line(lex_strterm, ruby_sourceline); ripper_flush(parser); - return term == '`' ? tXSTRING_BEG : tSTRING_BEG; + return token; } static void |