From 67b527a4df09ed650cebe61f5ba2ccbc0f31d889 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 16 Jul 2008 01:06:43 +0000 Subject: [PATCH] --- ase/lib/awk/parse.c | 16 ++++++++++++---- ase/lib/awk/run.c | 8 +++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ase/lib/awk/parse.c b/ase/lib/awk/parse.c index b39806ea..3d5956d8 100644 --- a/ase/lib/awk/parse.c +++ b/ase/lib/awk/parse.c @@ -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} */ @@ -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. * for example, "abc" ++ 10 => "abc" . ++10 */ - /* TOOD: probably left->type == ASE_AWK_NDE_POS should - * be inclued to handle $i++, $i--. */ - if (!is_var(left)) return left; + /*if (!is_var(left)) return left; XXX */ + if (!is_var(left) && left->type != ASE_AWK_NDE_POS) return left; } /* 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); 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)) { ase_awk_clrpt (awk, body); diff --git a/ase/lib/awk/run.c b/ase/lib/awk/run.c index 7c699831..4561830e 100644 --- a/ase/lib/awk/run.c +++ b/ase/lib/awk/run.c @@ -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} */ @@ -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. * but let's keep going this way for the time being. */ 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 ( 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. * but let's keep going this way for the time being. */ 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 ( run, ASE_AWK_EOPERAND, nde->line, ASE_NULL, 0);