ruby-changes:49713
From: nobu <ko1@a...>
Date: Mon, 15 Jan 2018 11:39:36 +0900 (JST)
Subject: [ruby-changes:49713] nobu:r61832 (trunk): more ytab.sed fixes
nobu 2018-01-15 11:39:32 +0900 (Mon, 15 Jan 2018) New Revision: 61832 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61832 Log: more ytab.sed fixes * tool/ytab.sed: fix for more old bison which does not support %lex-param at yydestruct (missed at the previous commit). define yy_stack_print macro to add `p` argument instead of replacement at callers. Modified files: trunk/tool/ytab.sed Index: tool/ytab.sed =================================================================== --- tool/ytab.sed (revision 61831) +++ tool/ytab.sed (revision 61832) @@ -12,13 +12,13 @@ i\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L12 a\ #endif } -/^yydestruct.*yymsg/,/#endif/{ +/^yydestruct.*yymsg/,/{/{ /^yydestruct/{ /[, *]p)/!{ H s/^/ruby_parser_&/ s/)$/, p)/ - /\*/s/parser)$/struct parser_params *&/ + /\*/s/p)$/struct parser_params *&/ } } /^#endif/{ @@ -26,16 +26,23 @@ a\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L26 /yydestruct/{ i\ \ struct parser_params *p; - a\ + } + x + } + /^{/{ + x + /yydestruct/{ + i\ #define yydestruct(m, t, v) ruby_parser_yydestruct(m, t, v, p) } x } } -/^yy_stack_print /,/#endif/{ +/^yy_stack_print /,/{/{ /^yy_stack_print/{ /[, *]p)/!{ H + s/^/ruby_parser_&/ s/)$/, p)/ /\*/s/p)$/struct parser_params *&/ } @@ -48,15 +55,14 @@ a\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L55 } x } -} -/yy_stack_print.*;/{ - x - /yy_stack_print/{ + /^{/{ x - s/\(yy_stack_print *\)(\(.*\));/\1(\2, p);/ + /yy_stack_print/{ + i\ +#define yy_stack_print(b, t) ruby_parser_yy_stack_print(b, t, p) + } x } - x } /^yy_reduce_print/,/^}/{ s/fprintf *(stderr,/YYFPRINTF (p,/g -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/