ruby-changes:55705
From: Nobuyoshi <ko1@a...>
Date: Fri, 10 May 2019 22:04:58 +0900 (JST)
Subject: [ruby-changes:55705] Nobuyoshi Nakada: 79931dddba (trunk): Propagate parser_params to rb_yytnamerr
https://git.ruby-lang.org/ruby.git/commit/?id=79931dddba From 79931dddba67ad68886f65ba8562eb99507cee3a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 10 May 2019 16:40:34 +0900 Subject: Propagate parser_params to rb_yytnamerr diff --git a/parse.y b/parse.y index fd08109..60ca58f 100644 --- a/parse.y +++ b/parse.y @@ -649,8 +649,8 @@ rb_strterm_mark(VALUE obj) https://github.com/ruby/ruby/blob/trunk/parse.y#L649 } #endif -#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(yyres, yystr) -size_t rb_yytnamerr(char *yyres, const char *yystr); +#define yytnamerr(yyres, yystr) (YYSIZE_T)rb_yytnamerr(p, yyres, yystr) +size_t rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr); #define TOKEN2ID(tok) ( \ tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \ @@ -12273,8 +12273,9 @@ count_char(const char *str, int c) https://github.com/ruby/ruby/blob/trunk/parse.y#L12273 * "\"`class' keyword\"" => "`class' keyword" */ RUBY_FUNC_EXPORTED size_t -rb_yytnamerr(char *yyres, const char *yystr) +rb_yytnamerr(struct parser_params *p, char *yyres, const char *yystr) { + YYUSE(p); if (*yystr == '"') { size_t yyn = 0, bquote = 0; const char *yyp = yystr; diff --git a/tool/ytab.sed b/tool/ytab.sed index f743807..ba7566a 100755 --- a/tool/ytab.sed +++ b/tool/ytab.sed @@ -67,6 +67,8 @@ a\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L67 /^yy_reduce_print/,/^}/{ s/fprintf *(stderr,/YYFPRINTF (p,/g } +s/^yysyntax_error (/&struct parser_params *p, / +s/ yysyntax_error (/&p, / s/\( YYFPRINTF *(\)yyoutput,/\1p,/ s/\( YYFPRINTF *(\)yyo,/\1p,/ s/\( YYFPRINTF *(\)stderr,/\1p,/ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/