This commit is contained in:
hyung-hwan 2008-01-01 07:30:18 +00:00
parent 67cc499f97
commit 1cbc7b9db5
2 changed files with 22 additions and 2 deletions

View File

@ -3011,6 +3011,7 @@ static ase_awk_val_t* eval_expression (ase_awk_run_t* run, ase_awk_nde_t* nde)
ase_awk_val_t* v;
int n, errnum;
#if 0
if (run->exit_level >= EXIT_GLOBAL)
{
/* returns ASE_NULL as if an error occurred but
@ -3020,6 +3021,7 @@ static ase_awk_val_t* eval_expression (ase_awk_run_t* run, ase_awk_nde_t* nde)
run->errnum = ASE_AWK_ENOERR;
return ASE_NULL;
}
#endif
v = eval_expression0 (run, nde);
if (v == ASE_NULL) return ASE_NULL;
@ -3109,10 +3111,28 @@ static ase_awk_val_t* eval_expression0 (ase_awk_run_t* run, ase_awk_nde_t* nde)
eval_getline
};
ase_awk_val_t* v;
ASE_ASSERT (nde->type >= ASE_AWK_NDE_GRP &&
(nde->type - ASE_AWK_NDE_GRP) < ASE_COUNTOF(eval_func));
return eval_func[nde->type-ASE_AWK_NDE_GRP] (run, nde);
v = eval_func[nde->type-ASE_AWK_NDE_GRP] (run, nde);
if (v != ASE_NULL && run->exit_level >= EXIT_GLOBAL)
{
ase_awk_refupval (run, v);
ase_awk_refdownval (run, v);
/* returns ASE_NULL as if an error occurred but
* clears the error number. run_main will
* detect this condition and treat it as a
* non-error condition.*/
run->errnum = ASE_AWK_ENOERR;
return ASE_NULL;
}
return v;
}
static ase_awk_val_t* eval_group (ase_awk_run_t* run, ase_awk_nde_t* nde)

View File

@ -645,7 +645,7 @@ static struct
{ ASE_T("baseone"), TestAwk::OPT_BASEONE },
{ ASE_T("stripspaces"), TestAwk::OPT_STRIPSPACES },
{ ASE_T("nextofile"), TestAwk::OPT_NEXTOFILE },
{ ASE_T("crfl"), TestAwk::OPT_CRLF },
{ ASE_T("crlf"), TestAwk::OPT_CRLF },
{ ASE_T("argstomain"), TestAwk::OPT_ARGSTOMAIN },
{ ASE_T("reset"), TestAwk::OPT_RESET },
{ ASE_T("maptovar"), TestAwk::OPT_MAPTOVAR },