summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 09:03:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 09:03:24 +0000
commitdecb59ba8359a38335fdb87de6904497e812ae53 (patch)
tree148c9ee94c76215fef04a4ae52b6427abf5a09d8
parentfb284ee7f814644b54a676424695fe932e9c3e7e (diff)
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
-rw-r--r--parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index abedadb..89c6599 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 <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 '\\';