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

ruby-changes:41021

From: nobu <ko1@a...>
Date: Mon, 14 Dec 2015 01:55:06 +0900 (JST)
Subject: [ruby-changes:41021] nobu:r53100 (trunk): ytab.sed: replace argument

nobu	2015-12-14 01:54:43 +0900 (Mon, 14 Dec 2015)

  New Revision: 53100

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

  Log:
    ytab.sed: replace argument
    
    * tool/ytab.sed: substitute the first argument of YYFPRINTF, instead
      of substitution by preprocessor, not to redefine stderr.

  Modified files:
    trunk/parse.y
    trunk/tool/ytab.sed
Index: parse.y
===================================================================
--- parse.y	(revision 53099)
+++ parse.y	(revision 53100)
@@ -44,13 +44,7 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L44
 #define YYREALLOC(ptr, size)	rb_parser_realloc(parser, (ptr), (size))
 #define YYCALLOC(nelem, size)	rb_parser_calloc(parser, (nelem), (size))
 #define YYFREE(ptr)		rb_parser_free(parser, (ptr))
-#ifdef HAVE_VA_ARGS_MACRO
-# define YYFPRINTF(f, fmt, ...) rb_parser_printf(parser, fmt, ##__VA_ARGS__)
-#else
-# define YYFPRINTF		rb_parser_printf
-# undef stderr
-# define stderr 		parser
-#endif
+#define YYFPRINTF		rb_parser_printf
 #undef malloc
 #undef realloc
 #undef calloc
Index: tool/ytab.sed
===================================================================
--- tool/ytab.sed	(revision 53099)
+++ tool/ytab.sed	(revision 53100)
@@ -47,16 +47,9 @@ a\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L47
   }
   x
 }
-/^yy_symbol_value_print/{
-  a\
-#define yy_symbol_value_print(output, type, value, parser) yy_symbol_value_print(0, type, value, parser)
-}
-/^yy_symbol_print/{
-  a\
-#define yy_symbol_print(output, type, value, parser) yy_symbol_print(0, type, value, parser)
-  a\
-#define yyoutput parser
-}
+s/\( YYFPRINTF *(\)yyoutput,/\1parser,/
+s/\( YYFPRINTF *(\)stderr,/\1parser,/
+s/\( YYDPRINTF *((\)stderr,/\1parser,/
 s/^\([ 	]*\)\(yyerror[ 	]*([ 	]*parser,\)/\1parser_\2/
 s!^ *extern char \*getenv();!/* & */!
 s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/

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

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