1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: tSPACE for old bison

* parse.y (tSPACE): define a separate token for escaped space, to
  fix `redefining user token number of ' '` error at word list
  separator on bison 2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-06 09:03:24 +00:00
parent fb284ee7f8
commit decb59ba83

View file

@ -838,7 +838,7 @@ static void token_info_pop(struct parser_params*, const char *token, const rb_co
%token <id> '.'
/* escaped chars, should be ignored otherwise */
%token <id> '\\' "backslash"
%token <id> ' ' "escaped space"
%token tSPACE "escaped space"
%token <id> '\t' "escaped horizontal tab"
%token <id> '\f' "escaped form feed"
%token <id> '\r' "escaped carriage return"
@ -8101,6 +8101,7 @@ parser_yylex(struct parser_params *p)
dispatch_scan_event(p, tSP);
goto retry; /* skip \\n */
}
if (c == ' ') return tSPACE;
if (ISSPACE(c)) return c;
pushback(p, c);
return '\\';