summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 02:39:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 02:39:32 +0000
commit65236c069e6bc3870aae210f3b24f29f0992ac11 (patch)
tree774e60ba8c968b6fa67a8d272be7e453ad9cbf28 /tool
parent8f745a2fab4f5aacb07db191a8390677a685003e (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/ytab.sed26
1 files changed, 16 insertions, 10 deletions
diff --git a/tool/ytab.sed b/tool/ytab.sed
index 75a8785b60..4b968fbed1 100755
--- a/tool/ytab.sed
+++ b/tool/ytab.sed
@@ -12,13 +12,13 @@ i\
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\
/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\
}
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