diff --git a/ase/awk/run.c b/ase/awk/run.c index ef1db26d..3190ed0a 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.24 2006-03-27 14:59:57 bacon Exp $ + * $Id: run.c,v 1.25 2006-03-28 11:32:58 bacon Exp $ */ #include @@ -52,9 +52,23 @@ int __printval (xp_awk_pair_t* pair) int xp_awk_run (xp_awk_t* awk) { + xp_size_t nglobals; + // TODO: clear run stack/exit_level awk->run.exit_level = EXIT_NONE; + + nglobals = awk->tree.nglobals; + while (nglobals > 0) + { + --nglobals; + if (__raw_push(awk,xp_awk_val_nil) == -1) + { + // TODO: error handling + return -1; + } + } + if (awk->tree.begin != XP_NULL) { xp_assert (awk->tree.begin->type == XP_AWK_NDE_BLK); @@ -447,8 +461,8 @@ static xp_awk_val_t* __eval_expression (xp_awk_t* awk, xp_awk_nde_t* nde) case XP_AWK_NDE_GLOBAL: { - xp_awk_nde_var_t* tgt = (xp_awk_nde_var_t*)nde; - val = STACK_GLOBAL(awk,tgt->id.idxa); + //xp_awk_nde_var_t* tgt = (xp_awk_nde_var_t*)nde; + //val = STACK_GLOBAL(awk,tgt->id.idxa); } break; diff --git a/ase/awk/val.h b/ase/awk/val.h index 153f620a..6956b246 100644 --- a/ase/awk/val.h +++ b/ase/awk/val.h @@ -1,5 +1,5 @@ /* - * $Id: val.h,v 1.10 2006-03-27 15:44:38 bacon Exp $ + * $Id: val.h,v 1.11 2006-03-28 11:32:58 bacon Exp $ */ #ifndef _XP_AWK_VAL_H_ @@ -66,7 +66,7 @@ struct xp_awk_val_str_t struct xp_awk_val_map_t { XP_AWK_VAL_HDR; - xp_awk_vap_t vap; + //xp_awk_vap_t vap; }; #ifdef __cplusplus