зеркало из https://github.com/github/ruby.git
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:
Родитель
fb284ee7f8
Коммит
decb59ba83
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 '\\';
|
||||
|
|
Загрузка…
Ссылка в новой задаче