ruby-changes:36140
From: nobu <ko1@a...>
Date: Sat, 1 Nov 2014 15:59:48 +0900 (JST)
Subject: [ruby-changes:36140] nobu:r48221 (trunk): parse.y: separate error messages
nobu 2014-11-01 15:59:43 +0900 (Sat, 01 Nov 2014) New Revision: 48221 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48221 Log: parse.y: separate error messages * parse.y (parse_atmark): separate error messages for sigil types, and make more descriptive Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 48220) +++ parse.y (revision 48221) @@ -7576,7 +7576,12 @@ parse_atmark(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L7576 c = nextc(); } if (c == -1 || ISSPACE(c)) { - compile_error(PARSER_ARG "unexpected @"); + if (result == tIVAR) { + compile_error(PARSER_ARG "`@' without identifiers is not allowed as an instance variable name"); + } + else { + compile_error(PARSER_ARG "`@@' without identifiers is not allowed as a class variable name"); + } return 0; } else if (ISDIGIT(c) || !parser_is_identchar()) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/