From b145e38f97ec39eaf3aef4d5bf18b6d70d282c00 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 2 May 2006 15:06:01 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/parse.c | 42 +++++++++++++++++++++++++++++++++++------- ase/awk/run.c | 3 ++- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/ase/awk/parse.c b/ase/awk/parse.c index b787782f..d98cde2b 100644 --- a/ase/awk/parse.c +++ b/ase/awk/parse.c @@ -1,5 +1,5 @@ /* - * $Id: parse.c,v 1.98 2006-04-30 17:12:51 bacon Exp $ + * $Id: parse.c,v 1.99 2006-05-02 15:06:01 bacon Exp $ */ #include @@ -1893,14 +1893,42 @@ static xp_awk_nde_t* __parse_primary (xp_awk_t* awk) static xp_awk_nde_t* __parse_hashidx (xp_awk_t* awk, xp_char_t* name) { - xp_awk_nde_t* idx; + xp_awk_nde_t* idx, * tmp, * last; xp_awk_nde_var_t* nde; xp_size_t idxa; - if (__get_token(awk) == -1) return XP_NULL; + idx = XP_NULL; + last = XP_NULL; - idx = __parse_expression (awk); - if (idx == XP_NULL) return XP_NULL; + do + { + if (__get_token(awk) == -1) + { + if (idx != XP_NULL) xp_awk_clrpt (idx); + return XP_NULL; + } + + tmp = __parse_expression (awk); + if (tmp == XP_NULL) + { + if (idx != XP_NULL) xp_awk_clrpt (idx); + return XP_NULL; + } + + if (idx == XP_NULL) + { + xp_assert (last == XP_NULL); + idx = tmp; last = tmp; + } + else + { + tmp->next = last; + last = tmp; + } + } + while (MATCH(awk,TOKEN_COMMA)); + + xp_assert (idx != XP_NULL); if (!MATCH(awk,TOKEN_RBRACK)) { @@ -1914,7 +1942,7 @@ static xp_awk_nde_t* __parse_hashidx (xp_awk_t* awk, xp_char_t* name) return XP_NULL; } - nde = (xp_awk_nde_var_t*)xp_malloc(xp_sizeof(xp_awk_nde_var_t)); + nde = (xp_awk_nde_var_t*) xp_malloc (xp_sizeof(xp_awk_nde_var_t)); if (nde == XP_NULL) { xp_awk_clrpt (idx); @@ -1922,7 +1950,7 @@ static xp_awk_nde_t* __parse_hashidx (xp_awk_t* awk, xp_char_t* name) } /* search the parameter name list */ - idxa = xp_awk_tab_find(&awk->parse.params, name, 0); + idxa = xp_awk_tab_find (&awk->parse.params, name, 0); if (idxa != (xp_size_t)-1) { nde->type = XP_AWK_NDE_ARGIDX; diff --git a/ase/awk/run.c b/ase/awk/run.c index 6e0219fa..370b52db 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.80 2006-04-30 17:10:30 bacon Exp $ + * $Id: run.c,v 1.81 2006-05-02 15:06:01 bacon Exp $ */ #include @@ -888,6 +888,7 @@ static int __run_exit_statement (xp_awk_run_t* run, xp_awk_nde_exit_t* nde) static int __run_next_statement (xp_awk_run_t* run, xp_awk_nde_next_t* nde) { /* TODO */ +xp_printf (XP_TEXT("**** next NOT IMPLEMENTED...\n")); return -1; }