зеркало из https://github.com/github/ruby.git
* parse.y (warn_balanced): removed false warning.
* parse.y (parser_yylex): skip whitespaces after method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6a77fa1d15
Коммит
36f8540a2b
|
@ -1,3 +1,9 @@
|
|||
Thu Apr 22 16:43:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (warn_balanced): removed false warning.
|
||||
|
||||
* parse.y (parser_yylex): skip whitespaces after method name.
|
||||
|
||||
Wed Apr 22 02:16:00 2010 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.[ch]: replace _DEBUG with BIGDECIMAL_DEBUG
|
||||
|
|
10
parse.y
10
parse.y
|
@ -6485,7 +6485,10 @@ parser_prepare(struct parser_params *parser)
|
|||
#else
|
||||
#define ambiguous_operator(op, syn) dispatch2(operator_ambiguous, ripper_intern(op), rb_str_new_cstr(syn))
|
||||
#endif
|
||||
#define warn_balanced(op, syn) (space_seen && !ISSPACE(c) && (ambiguous_operator(op, syn), 0))
|
||||
#define warn_balanced(op, syn) \
|
||||
(lex_state != EXPR_DOT && lex_state != EXPR_FNAME && \
|
||||
space_seen && !ISSPACE(c) && \
|
||||
(ambiguous_operator(op, syn), 0))
|
||||
|
||||
static int
|
||||
parser_yylex(struct parser_params *parser)
|
||||
|
@ -7699,6 +7702,11 @@ parser_yylex(struct parser_params *parser)
|
|||
}
|
||||
}
|
||||
|
||||
if (lex_state == EXPR_FNAME) {
|
||||
const char *p = lex_p, *pe = lex_pend;
|
||||
while (p < pe && (*p == ' ' || *p == '\t')) p++;
|
||||
if (p < pe && *p != '(') lex_p = p;
|
||||
}
|
||||
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
||||
IS_ARG()) {
|
||||
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче