From d2a03300d33ef6b24fd4492aa3917ce41b4512ae Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Mar 2018 08:32:46 +0000 Subject: parse.y: named whitespaces * parse.y: named escaped whitespaces to show unexpected character. bare whitespaces should not appear outside of word_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index b2bbafe123..abedadb7d7 100644 --- a/parse.y +++ b/parse.y @@ -836,7 +836,13 @@ static void token_info_pop(struct parser_params*, const char *token, const rb_co %type f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop dot_or_colon %token END_OF_INPUT 0 "end-of-input" %token '.' +/* escaped chars, should be ignored otherwise */ %token '\\' "backslash" +%token ' ' "escaped space" +%token '\t' "escaped horizontal tab" +%token '\f' "escaped form feed" +%token '\r' "escaped carriage return" +%token '\13' "escaped vertical tab" %token tUPLUS RUBY_TOKEN(UPLUS) "unary+" %token tUMINUS RUBY_TOKEN(UMINUS) "unary-" %token tPOW RUBY_TOKEN(POW) "**" @@ -8095,6 +8101,7 @@ parser_yylex(struct parser_params *p) dispatch_scan_event(p, tSP); goto retry; /* skip \\n */ } + if (ISSPACE(c)) return c; pushback(p, c); return '\\'; -- cgit v1.2.3