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:
parent
fb284ee7f8
commit
decb59ba83
1 changed files with 2 additions and 1 deletions
3
parse.y
3
parse.y
|
@ -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 '\\';
|
||||
|
|
Loading…
Reference in a new issue