зеркало из https://github.com/github/ruby.git
Propagate parser_params to rb_yytnamerr
This commit is contained in:
Родитель
dc65e75101
Коммит
79931dddba
7
parse.y
7
parse.y
|
@ -649,8 +649,8 @@ rb_strterm_mark(VALUE obj)
|
|||
}
|
||||
#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)
|
|||
* "\"`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;
|
||||
|
|
|
@ -67,6 +67,8 @@ a\
|
|||
/^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,/
|
||||
|
|
Загрузка…
Ссылка в новой задаче