diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-23 03:37:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-23 03:37:21 +0000 |
commit | 8563942ad99bab4aeeb66f9ae29ad7ac32f4a172 (patch) | |
tree | e6190535fd96af45fd48b7cd1ce1c563c86318b7 /parse.y | |
parent | 63c047f10aa4b0b605d1c18488407eda54b59a44 (diff) |
parse.y: added new_strterm wrapper
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -5682,9 +5682,15 @@ tokadd_string(struct parser_params *p, return c; } +static inline rb_strterm_t * +new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0) +{ + return (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0); +} + /* imemo_parser_strterm for literal */ #define NEW_STRTERM(func, term, paren) \ - (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, (VALUE)(func), (VALUE)(paren), (VALUE)(term), 0) + new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0) #ifdef RIPPER static void @@ -5952,11 +5958,10 @@ heredoc_identifier(struct parser_params *p) len = p->lex.pcur - p->lex.pbeg; lex_goto_eol(p); - p->lex.strterm = (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, - STR_NEW(tok(), toklen()), /* term */ - p->lex.lastline, /* lastline */ - len, /* lastidx */ - p->ruby_sourceline); + p->lex.strterm = new_strterm(STR_NEW(tok(), toklen()), /* term */ + p->lex.lastline, /* lastline */ + len, /* lastidx */ + p->ruby_sourceline); p->lex.strterm->flags |= STRTERM_HEREDOC; token_flush(p); |