summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-31 03:15:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-31 03:15:33 +0000
commitf758195486cbe49c647140a9e1c5623eeebbeaac (patch)
tree7d2c78d56467677cf1787452c3e630229c9bf4bb /parse.y
parente13bfb15096a9d12e93055fbe6526d15bc54e20c (diff)
* parse.y (yylex): remove EXPR_CMDARG according to the RHG book.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y25
1 files changed, 6 insertions, 19 deletions
diff --git a/parse.y b/parse.y
index 3adbecf..00be373 100644
--- a/parse.y
+++ b/parse.y
@@ -68,7 +68,6 @@ static enum lex_state {
EXPR_BEG, /* ignore newline, +/- is a sign. */
EXPR_END, /* newline significant, +/- is a operator. */
EXPR_ARG, /* newline significant, +/- is a operator. */
- EXPR_CMDARG, /* newline significant, +/- is a operator. */
EXPR_ENDARG, /* newline significant, +/- is a operator. */
EXPR_MID, /* newline significant, +/- is a operator. */
EXPR_FNAME, /* ignore newline, no reserved words. */
@@ -3240,7 +3239,7 @@ arg_ambiguous()
rb_warning("ambiguous first argument; make sure");
}
-#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
+#define IS_ARG() (lex_state == EXPR_ARG)
static int
yylex()
@@ -3464,10 +3463,7 @@ yylex()
return c;
}
if (lex_state == EXPR_DOT) {
- if (cmd_state)
- lex_state = EXPR_CMDARG;
- else
- lex_state = EXPR_ARG;
+ lex_state = EXPR_ARG;
return c;
}
lex_strterm = NEW_STRTERM(str_xquote, '`', 0);
@@ -3998,10 +3994,7 @@ yylex()
c = tLPAREN;
}
else if (space_seen) {
- if (lex_state == EXPR_CMDARG) {
- c = tLPAREN_ARG;
- }
- else if (lex_state == EXPR_ARG) {
+ if (lex_state == EXPR_ARG) {
c = tLPAREN_ARG;
yylval.id = last_id;
}
@@ -4350,7 +4343,7 @@ yylex()
}
if (kw->id[0] == kDO) {
if (COND_P()) return kDO_COND;
- if (CMDARG_P() && state != EXPR_CMDARG)
+ if (CMDARG_P())
return kDO_BLOCK;
if (state == EXPR_ENDARG)
return kDO_BLOCK;
@@ -4369,14 +4362,8 @@ yylex()
if (lex_state == EXPR_BEG ||
lex_state == EXPR_MID ||
lex_state == EXPR_DOT ||
- lex_state == EXPR_ARG ||
- lex_state == EXPR_CMDARG) {
- if (cmd_state) {
- lex_state = EXPR_CMDARG;
- }
- else {
- lex_state = EXPR_ARG;
- }
+ lex_state == EXPR_ARG) {
+ lex_state = EXPR_ARG;
}
else {
lex_state = EXPR_END;