summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 16:54:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 16:54:43 +0000
commitd2e19fdc4225f5d82d82352040bb00a3d31166f4 (patch)
tree7d19d56a6e54a372e044129f36011573e3c03d28
parenta7b67cc82e8d0f5072d436f35ff4e1a0685208a7 (diff)
ytab.sed: replace argument
* tool/ytab.sed: substitute the first argument of YYFPRINTF, instead of substitution by preprocessor, not to redefine stderr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y8
-rwxr-xr-xtool/ytab.sed13
2 files changed, 4 insertions, 17 deletions
diff --git a/parse.y b/parse.y
index 4c418d3..9791a67 100644
--- a/parse.y
+++ b/parse.y
@@ -44,13 +44,7 @@
#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
diff --git a/tool/ytab.sed b/tool/ytab.sed
index c1700ed..ce5a942 100755
--- a/tool/ytab.sed
+++ b/tool/ytab.sed
@@ -47,16 +47,9 @@ a\
}
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"/