diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-06 09:03:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-06 09:03:24 +0000 |
commit | decb59ba8359a38335fdb87de6904497e812ae53 (patch) | |
tree | 148c9ee94c76215fef04a4ae52b6427abf5a09d8 /parse.y | |
parent | fb284ee7f814644b54a676424695fe932e9c3e7e (diff) | |
download | ruby-decb59ba8359a38335fdb87de6904497e812ae53.tar.gz |
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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 '\\'; |