This commit is contained in:
hyung-hwan 2008-07-16 01:06:43 +00:00
parent 754c2970af
commit 67b527a4df
2 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: parse.c 245 2008-07-15 05:56:32Z baconevi $ * $Id: parse.c 246 2008-07-15 07:06:43Z baconevi $
* *
* {License} * {License}
*/ */
@ -2685,9 +2685,8 @@ static ase_awk_nde_t* parse_increment (ase_awk_t* awk, ase_size_t line)
* the primary should be treated specially. * the primary should be treated specially.
* for example, "abc" ++ 10 => "abc" . ++10 * for example, "abc" ++ 10 => "abc" . ++10
*/ */
/* TOOD: probably left->type == ASE_AWK_NDE_POS should /*if (!is_var(left)) return left; XXX */
* be inclued to handle $i++, $i--. */ if (!is_var(left) && left->type != ASE_AWK_NDE_POS) return left;
if (!is_var(left)) return left;
} }
/* check for postfix increment operator */ /* check for postfix increment operator */
@ -4010,6 +4009,15 @@ static ase_awk_nde_t* parse_dowhile (ase_awk_t* awk, ase_size_t line)
body = parse_statement (awk, awk->token.line); body = parse_statement (awk, awk->token.line);
if (body == ASE_NULL) return ASE_NULL; if (body == ASE_NULL) return ASE_NULL;
while (MATCH(awk,TOKEN_NEWLINE))
{
if (get_token(awk) == -1)
{
ase_awk_clrpt (awk, body);
return ASE_NULL;
}
}
if (!MATCH(awk,TOKEN_WHILE)) if (!MATCH(awk,TOKEN_WHILE))
{ {
ase_awk_clrpt (awk, body); ase_awk_clrpt (awk, body);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c 238 2008-07-09 14:07:47Z baconevi $ * $Id: run.c 246 2008-07-15 07:06:43Z baconevi $
* *
* {License} * {License}
*/ */
@ -4896,7 +4896,8 @@ static ase_awk_val_t* eval_incpre (ase_awk_run_t* run, ase_awk_nde_t* nde)
* ugly as it is dependent of the values defined in tree.h. * ugly as it is dependent of the values defined in tree.h.
* but let's keep going this way for the time being. */ * but let's keep going this way for the time being. */
if (exp->left->type < ASE_AWK_NDE_NAMED || if (exp->left->type < ASE_AWK_NDE_NAMED ||
exp->left->type > ASE_AWK_NDE_ARGIDX) /*exp->left->type > ASE_AWK_NDE_ARGIDX) XXX */
exp->left->type > ASE_AWK_NDE_POS)
{ {
ase_awk_setrunerror ( ase_awk_setrunerror (
run, ASE_AWK_EOPERAND, nde->line, ASE_NULL, 0); run, ASE_AWK_EOPERAND, nde->line, ASE_NULL, 0);
@ -5070,7 +5071,8 @@ static ase_awk_val_t* eval_incpst (ase_awk_run_t* run, ase_awk_nde_t* nde)
* ugly as it is dependent of the values defined in tree.h. * ugly as it is dependent of the values defined in tree.h.
* but let's keep going this way for the time being. */ * but let's keep going this way for the time being. */
if (exp->left->type < ASE_AWK_NDE_NAMED || if (exp->left->type < ASE_AWK_NDE_NAMED ||
exp->left->type > ASE_AWK_NDE_ARGIDX) /*exp->left->type > ASE_AWK_NDE_ARGIDX) XXX */
exp->left->type > ASE_AWK_NDE_POS)
{ {
ase_awk_setrunerror ( ase_awk_setrunerror (
run, ASE_AWK_EOPERAND, nde->line, ASE_NULL, 0); run, ASE_AWK_EOPERAND, nde->line, ASE_NULL, 0);