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

ruby-changes:43943

From: nobu <ko1@a...>
Date: Sat, 27 Aug 2016 00:11:37 +0900 (JST)
Subject: [ruby-changes:43943] nobu:r56016 (trunk): parse.y: STR_TERM_END

nobu	2016-08-27 00:11:32 +0900 (Sat, 27 Aug 2016)

  New Revision: 56016

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

  Log:
    parse.y: STR_TERM_END
    
    * parse.y (parser_parse_string): store the end of string literal
      mark in nd_term instead of nd_func.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 56015)
+++ parse.y	(revision 56016)
@@ -5577,6 +5577,7 @@ rb_parser_compile_file_path(VALUE vparse https://github.com/ruby/ruby/blob/trunk/parse.y#L5577
 #define STR_FUNC_SYMBOL 0x10
 #define STR_FUNC_INDENT 0x20
 #define STR_FUNC_LABEL  0x40
+#define STR_TERM_END    -1
 
 enum string_type {
     str_label  = STR_FUNC_LABEL,
@@ -6349,7 +6350,7 @@ parser_parse_string(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L6350
     int c, space = 0;
     rb_encoding *enc = current_enc;
 
-    if (func == -1) return tSTRING_END;
+    if (term == STR_TERM_END) return tSTRING_END;
     c = nextc();
     if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
 	do {c = nextc();} while (ISSPACE(c));
@@ -6357,7 +6358,7 @@ parser_parse_string(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L6358
     }
     if (c == term && !quote->nd_nest) {
 	if (func & STR_FUNC_QWORDS) {
-	    quote->nd_func = -1;
+	    quote->u2.id = STR_TERM_END;
 	    return ' ';
 	}
 	return parser_string_term(parser, func);
@@ -6794,7 +6795,7 @@ parser_here_document(struct parser_param https://github.com/ruby/ruby/blob/trunk/parse.y#L6795
 			    yylval.val, str);
 #endif
     heredoc_restore(lex_strterm);
-    lex_strterm = NEW_STRTERM(-1, 0, 0);
+    lex_strterm = NEW_STRTERM(func, STR_TERM_END, 0);
     set_yylval_str(str);
     return tSTRING_CONTENT;
 }

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

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