parse.y: token name of tSTRING_DEND
* parse.y (rb_yytnamerr): show single-quoted single char as-is, to show a quoted closing brace as tSTRING_DEND. e.g.: $ ./ruby -e '"#{true' -e:1: syntax error, unexpected end-of-input, expecting '}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
71342a46ac
commit
c56f61161a
9
parse.y
9
parse.y
@ -924,7 +924,8 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
|
|||||||
%token tSYMBOLS_BEG "symbol list"
|
%token tSYMBOLS_BEG "symbol list"
|
||||||
%token tQSYMBOLS_BEG "verbatim symbol list"
|
%token tQSYMBOLS_BEG "verbatim symbol list"
|
||||||
%token tSTRING_END "terminator"
|
%token tSTRING_END "terminator"
|
||||||
%token tSTRING_DBEG tSTRING_DEND tSTRING_DVAR tLAMBEG tLABEL_END
|
%token tSTRING_DEND "'}'"
|
||||||
|
%token tSTRING_DBEG tSTRING_DVAR tLAMBEG tLABEL_END
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* precedence table
|
* precedence table
|
||||||
@ -11220,6 +11221,12 @@ rb_yytnamerr(char *yyres, const char *yystr)
|
|||||||
bquote = 0;
|
bquote = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (yyp[1] && yyp[1] != '\'' && yyp[2] == '\'') {
|
||||||
|
if (yyres) memcpy(yyres + yyn, yyp, 3);
|
||||||
|
yyn += 3;
|
||||||
|
yyp += 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
goto do_not_strip_quotes;
|
goto do_not_strip_quotes;
|
||||||
|
|
||||||
case ',':
|
case ',':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user