* parse.y (parser_yylex): simplified with IS_ARG and IS_END.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a3201dae6
commit
85cb4ee236
8
parse.y
8
parse.y
@ -6658,10 +6658,9 @@ parser_yylex(struct parser_params *parser)
|
|||||||
case '<':
|
case '<':
|
||||||
c = nextc();
|
c = nextc();
|
||||||
if (c == '<' &&
|
if (c == '<' &&
|
||||||
lex_state != EXPR_END &&
|
|
||||||
lex_state != EXPR_DOT &&
|
lex_state != EXPR_DOT &&
|
||||||
lex_state != EXPR_ENDARG &&
|
|
||||||
lex_state != EXPR_CLASS &&
|
lex_state != EXPR_CLASS &&
|
||||||
|
!IS_END() &&
|
||||||
(!IS_ARG() || space_seen)) {
|
(!IS_ARG() || space_seen)) {
|
||||||
int token = heredoc_identifier();
|
int token = heredoc_identifier();
|
||||||
if (token) return token;
|
if (token) return token;
|
||||||
@ -6737,7 +6736,7 @@ parser_yylex(struct parser_params *parser)
|
|||||||
return tSTRING_BEG;
|
return tSTRING_BEG;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) {
|
if (IS_END()) {
|
||||||
lex_state = EXPR_VALUE;
|
lex_state = EXPR_VALUE;
|
||||||
return '?';
|
return '?';
|
||||||
}
|
}
|
||||||
@ -7625,8 +7624,7 @@ parser_yylex(struct parser_params *parser)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
||||||
lex_state == EXPR_ARG ||
|
IS_ARG()) {
|
||||||
lex_state == EXPR_CMDARG) {
|
|
||||||
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
||||||
lex_state = EXPR_BEG;
|
lex_state = EXPR_BEG;
|
||||||
nextc();
|
nextc();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user