From decb59ba8359a38335fdb87de6904497e812ae53 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 6 Mar 2018 09:03:24 +0000 Subject: 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 --- parse.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parse.y b/parse.y index abedadb7d7..89c65992c4 100644 --- a/parse.y +++ b/parse.y @@ -838,7 +838,7 @@ static void token_info_pop(struct parser_params*, const char *token, const rb_co %token '.' /* escaped chars, should be ignored otherwise */ %token '\\' "backslash" -%token ' ' "escaped space" +%token tSPACE "escaped space" %token '\t' "escaped horizontal tab" %token '\f' "escaped form feed" %token '\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 '\\'; -- cgit v1.2.3