[前][次][番号順一覧][スレッド一覧]

ruby-changes:49894

From: nobu <ko1@a...>
Date: Tue, 23 Jan 2018 12:37:26 +0900 (JST)
Subject: [ruby-changes:49894] nobu:r62012 (trunk): parse.y: added new_strterm wrapper

nobu	2018-01-23 12:37:21 +0900 (Tue, 23 Jan 2018)

  New Revision: 62012

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62012

  Log:
    parse.y: added new_strterm wrapper

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 62011)
+++ parse.y	(revision 62012)
@@ -5682,9 +5682,15 @@ tokadd_string(struct parser_params *p, https://github.com/ruby/ruby/blob/trunk/parse.y#L5682
     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 https://github.com/ruby/ruby/blob/trunk/parse.y#L5958
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]