diff --git a/ase/awk/awk.h b/ase/awk/awk.h index 80185833..19247539 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.145 2006-11-19 10:12:07 bacon Exp $ + * $Id: awk.h,v 1.146 2006-11-19 11:21:06 bacon Exp $ */ #ifndef _ASE_AWK_AWK_H_ @@ -143,7 +143,7 @@ enum /* allow undeclared variables */ ASE_AWK_IMPLICIT = (1 << 0), - /* variable requires explicit declaration */ + /* allow explicit variable declarations */ ASE_AWK_EXPLICIT = (1 << 1), /* a function name should not coincide to be a variable name */ diff --git a/ase/awk/parse.c b/ase/awk/parse.c index e54d7ec8..e28e3264 100644 --- a/ase/awk/parse.c +++ b/ase/awk/parse.c @@ -1,5 +1,5 @@ /* - * $Id: parse.c,v 1.203 2006-11-17 07:04:31 bacon Exp $ + * $Id: parse.c,v 1.204 2006-11-19 11:21:06 bacon Exp $ */ #include @@ -4325,6 +4325,15 @@ static int __deparse (ase_awk_t* awk) ASE_AWK_ASSERT (awk, len != (ase_size_t)-1); if (ase_awk_putsrcstrx (awk, tmp, len) == -1) EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); + /* + if (ase_awk_putsrcstrx (awk, + awk->parse.globals.buf[i].name, + awk->parse.globals.buf[i].name_len) == -1) + { + EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); + } + */ + if (ase_awk_putsrcstr (awk, ASE_T(", ")) == -1) EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); } @@ -4334,6 +4343,15 @@ static int __deparse (ase_awk_t* awk) ASE_AWK_ASSERT (awk, len != (ase_size_t)-1); if (ase_awk_putsrcstrx (awk, tmp, len) == -1) EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); + /* + if (ase_awk_putsrcstrx (awk, + awk->parse.globals.buf[i].name, + awk->parse.globals.buf[i].name_len) == -1) + { + EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); + } + */ + if (ase_awk_putsrcstr (awk, ASE_T(";\n\n")) == -1) EXIT_DEPARSE (ASE_AWK_ESRCOUTWRITE); } diff --git a/ase/awk/tree.c b/ase/awk/tree.c index fc445b9f..9e83053e 100644 --- a/ase/awk/tree.c +++ b/ase/awk/tree.c @@ -1,5 +1,5 @@ /* - * $Id: tree.c,v 1.88 2006-11-18 15:36:57 bacon Exp $ + * $Id: tree.c,v 1.89 2006-11-19 11:21:06 bacon Exp $ */ #include @@ -384,6 +384,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde) px->id.idxa, 10, ASE_NULL, tmp, ase_countof(tmp)); PUT_SRCSTRX (awk, tmp, n); + /*PUT_SRCSTRX (awk, px->id.name, px->id.name_len);*/ } else { @@ -406,6 +407,7 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde) px->id.idxa, 10, ASE_NULL, tmp, ase_countof(tmp)); PUT_SRCSTRX (awk, tmp, n); + /*PUT_SRCSTRX (awk, px->id.name, px->id.name_len);*/ PUT_SRCSTR (awk, ASE_T("[")); } else diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index 721149b8..ed23753a 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.117 2006-11-19 07:45:46 bacon Exp $ + * $Id: awk.c,v 1.118 2006-11-19 11:21:06 bacon Exp $ */ #include @@ -743,9 +743,9 @@ static int __main (int argc, ase_char_t* argv[]) syscas_data_t syscas_data; #endif - opt = ASE_AWK_EXPLICIT | ASE_AWK_UNIQUE | ASE_AWK_HASHSIGN | + opt = ASE_AWK_IMPLICIT | ASE_AWK_EXPLICIT | ASE_AWK_UNIQUE | ASE_AWK_HASHSIGN | /*ASE_AWK_DBLSLASHES |*/ - ASE_AWK_SHADING | ASE_AWK_IMPLICIT | ASE_AWK_SHIFT | + ASE_AWK_SHADING | ASE_AWK_SHIFT | ASE_AWK_EXTIO | ASE_AWK_BLOCKLESS | ASE_AWK_STRINDEXONE | ASE_AWK_STRIPSPACES /*| ASE_AWK_NEWLINE*/;