mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (parser_yylex): allow reserved word to be keyword argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
20ed75a639
commit
c196780964
2 changed files with 14 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Oct 14 08:28:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_yylex): allow reserved word to be keyword argument.
|
||||
|
||||
Mon Oct 13 19:07:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* parse.y (token_info_pop): show source filename. [ruby-dev:36710]
|
||||
|
|
20
parse.y
20
parse.y
|
@ -7523,6 +7523,16 @@ parser_yylex(struct parser_params *parser)
|
|||
}
|
||||
}
|
||||
|
||||
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
||||
lex_state == EXPR_ARG ||
|
||||
lex_state == EXPR_CMDARG) {
|
||||
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
||||
lex_state = EXPR_BEG;
|
||||
nextc();
|
||||
set_yylval_id(TOK_INTERN(!ENC_SINGLE(mb)));
|
||||
return tLABEL;
|
||||
}
|
||||
}
|
||||
if (mb == ENC_CODERANGE_7BIT && lex_state != EXPR_DOT) {
|
||||
const struct kwtable *kw;
|
||||
|
||||
|
@ -7559,16 +7569,6 @@ parser_yylex(struct parser_params *parser)
|
|||
}
|
||||
}
|
||||
|
||||
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
||||
lex_state == EXPR_ARG ||
|
||||
lex_state == EXPR_CMDARG) {
|
||||
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
||||
lex_state = EXPR_BEG;
|
||||
nextc();
|
||||
set_yylval_id(TOK_INTERN(!ENC_SINGLE(mb)));
|
||||
return tLABEL;
|
||||
}
|
||||
}
|
||||
if (IS_BEG() ||
|
||||
lex_state == EXPR_DOT ||
|
||||
IS_ARG()) {
|
||||
|
|
Loading…
Reference in a new issue