*** empty log message ***
This commit is contained in:
parent
6883074383
commit
976c12d2bf
@ -47,7 +47,7 @@ MTL=midl.exe
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "XP_AWK_STAND_ALONE" /FD /c
|
||||
# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "XP_AWK_STAND_ALONE" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
@ -77,7 +77,7 @@ MTL=midl.exe
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "XP_AWK_STAND_ALONE" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "XP_AWK_STAND_ALONE" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
@ -106,7 +106,7 @@ LIB32=link.exe -lib
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
@ -140,7 +140,7 @@ LINK32=link.exe
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /c
|
||||
# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "_USRDLL" /D "XP_AWK_STAND_ALONE" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
|
@ -4,7 +4,7 @@ OUT = xpawk
|
||||
|
||||
CC = cl
|
||||
#CFLAGS = /nologo /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I../..
|
||||
CFLAGS = /nologo /O2 /MT /W3 /GR- /D_WIN32_WINNT=0x0400 -I../.. -DXP_AWK_STAND_ALONE -DXP_CHAR_IS_WCHAR
|
||||
CFLAGS = /nologo /O2 /MT /W3 /GR- /Za /D_WIN32_WINNT=0x0400 -I../.. -DXP_AWK_STAND_ALONE -DXP_CHAR_IS_WCHAR
|
||||
|
||||
all: lib
|
||||
|
||||
|
154
ase/awk/run.c
154
ase/awk/run.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: run.c,v 1.119 2006-06-30 17:07:52 bacon Exp $
|
||||
* $Id: run.c,v 1.120 2006-07-01 07:57:10 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -1095,20 +1095,17 @@ static int __run_delete (xp_awk_run_t* run, xp_awk_nde_delete_t* nde)
|
||||
|
||||
var = (xp_awk_nde_var_t*) nde->var;
|
||||
|
||||
xp_assert (var->type == XP_AWK_NDE_NAMED ||
|
||||
var->type == XP_AWK_NDE_GLOBAL ||
|
||||
var->type == XP_AWK_NDE_LOCAL ||
|
||||
var->type == XP_AWK_NDE_ARG ||
|
||||
var->type == XP_AWK_NDE_NAMEDIDX ||
|
||||
var->type == XP_AWK_NDE_GLOBALIDX ||
|
||||
var->type == XP_AWK_NDE_LOCALIDX ||
|
||||
var->type == XP_AWK_NDE_ARGIDX);
|
||||
|
||||
xp_printf (XP_T("********** __run_delete **************\n"));
|
||||
if (var->type == XP_AWK_NDE_NAMED)
|
||||
if (var->type == XP_AWK_NDE_NAMED ||
|
||||
var->type == XP_AWK_NDE_NAMEDIDX)
|
||||
{
|
||||
xp_awk_pair_t* pair;
|
||||
|
||||
xp_assert ((var->type == XP_AWK_NDE_NAMED &&
|
||||
var->idx == XP_NULL) ||
|
||||
(var->type == XP_AWK_NDE_NAMEDIDX &&
|
||||
var->idx != XP_NULL));
|
||||
|
||||
pair = xp_awk_map_get (&run->named, var->id.name);
|
||||
if (pair == XP_NULL)
|
||||
{
|
||||
@ -1131,62 +1128,61 @@ xp_printf (XP_T("********** __run_delete **************\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
xp_awk_val_t* val = (xp_awk_val_t*)pair->val;
|
||||
xp_awk_val_t* val;
|
||||
xp_awk_map_t* map;
|
||||
|
||||
val = (xp_awk_val_t*)pair->val;
|
||||
xp_assert (val != XP_NULL);
|
||||
if (val->type == XP_AWK_VAL_MAP)
|
||||
{
|
||||
|
||||
if (val->type != XP_AWK_VAL_MAP)
|
||||
PANIC_I (run, XP_AWK_ENOTDELETABLE);
|
||||
|
||||
xp_printf (XP_T("clearing map...\n"));
|
||||
xp_awk_map_clear (((xp_awk_val_map_t*)val)->map);
|
||||
map = ((xp_awk_val_map_t*)val)->map;
|
||||
if (var->type == XP_AWK_NDE_NAMEDIDX)
|
||||
{
|
||||
xp_char_t* key;
|
||||
xp_awk_val_t* idx;
|
||||
int errnum;
|
||||
|
||||
xp_assert (var->idx != XP_NULL);
|
||||
|
||||
idx = __eval_expression (run, var->idx);
|
||||
if (idx == XP_NULL) return -1;
|
||||
|
||||
xp_awk_refupval (idx);
|
||||
key = xp_awk_valtostr (idx, &errnum, XP_NULL);
|
||||
xp_awk_refdownval (run, idx);
|
||||
|
||||
if (key == XP_NULL) PANIC_I (run, errnum);
|
||||
|
||||
xp_awk_map_remove (map, key);
|
||||
xp_free (key);
|
||||
}
|
||||
else
|
||||
{
|
||||
PANIC_I (run, XP_AWK_ENOTDELETABLE);
|
||||
xp_awk_map_clear (map);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (var->type == XP_AWK_NDE_GLOBAL)
|
||||
else if (var->type == XP_AWK_NDE_GLOBAL ||
|
||||
var->type == XP_AWK_NDE_LOCAL ||
|
||||
var->type == XP_AWK_NDE_ARG ||
|
||||
var->type == XP_AWK_NDE_GLOBALIDX ||
|
||||
var->type == XP_AWK_NDE_LOCALIDX ||
|
||||
var->type == XP_AWK_NDE_ARGIDX)
|
||||
{
|
||||
xp_awk_val_t* val;
|
||||
|
||||
xp_printf (XP_T("clearing global...\n"));
|
||||
xp_printf (XP_T("clearing global/local/arg...\n"));
|
||||
if (var->type == XP_AWK_NDE_GLOBAL ||
|
||||
var->type == XP_AWK_NDE_GLOBALIDX)
|
||||
val = STACK_GLOBAL (run,var->id.idxa);
|
||||
xp_assert (val != XP_NULL);
|
||||
|
||||
if (val->type == XP_AWK_VAL_NIL)
|
||||
{
|
||||
xp_awk_val_t* tmp;
|
||||
|
||||
/* value not set for the named variable.
|
||||
* create a map and assign it to the variable */
|
||||
|
||||
tmp = xp_awk_makemapval (run);
|
||||
if (tmp == XP_NULL) PANIC_I (run, XP_AWK_ENOMEM);
|
||||
|
||||
/* no need to reduce the reference count of
|
||||
* the previous value because it was nil. */
|
||||
STACK_GLOBAL (run,var->id.idxa) = tmp;
|
||||
xp_awk_refupval (tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (val->type == XP_AWK_VAL_MAP)
|
||||
{
|
||||
xp_printf (XP_TEXT("clearning....\n"));
|
||||
xp_awk_map_clear (((xp_awk_val_map_t*)val)->map);
|
||||
}
|
||||
else
|
||||
{
|
||||
PANIC_I (run, XP_AWK_ENOTDELETABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (var->type == XP_AWK_NDE_LOCAL)
|
||||
{
|
||||
xp_awk_val_t* val;
|
||||
|
||||
xp_printf (XP_T("clearing lcoal...\n"));
|
||||
else if (var->type == XP_AWK_NDE_LOCAL ||
|
||||
var->type == XP_AWK_NDE_LOCALIDX)
|
||||
val = STACK_LOCAL (run,var->id.idxa);
|
||||
else val = STACK_ARG (run,var->id.idxa);
|
||||
|
||||
xp_assert (val != XP_NULL);
|
||||
|
||||
if (val->type == XP_AWK_VAL_NIL)
|
||||
@ -1201,26 +1197,56 @@ xp_printf (XP_T("clearing lcoal...\n"));
|
||||
|
||||
/* no need to reduce the reference count of
|
||||
* the previous value because it was nil. */
|
||||
if (var->type == XP_AWK_NDE_GLOBAL ||
|
||||
var->type == XP_AWK_NDE_GLOBALIDX)
|
||||
STACK_GLOBAL(run,var->id.idxa) = tmp;
|
||||
else if (var->type == XP_AWK_NDE_LOCAL ||
|
||||
var->type == XP_AWK_NDE_LOCALIDX)
|
||||
STACK_LOCAL(run,var->id.idxa) = tmp;
|
||||
else STACK_ARG(run,var->id.idxa) = tmp;
|
||||
|
||||
xp_awk_refupval (tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (val->type == XP_AWK_VAL_MAP)
|
||||
{
|
||||
xp_printf (XP_TEXT("clearning....\n"));
|
||||
xp_awk_map_clear (((xp_awk_val_map_t*)val)->map);
|
||||
}
|
||||
else
|
||||
{
|
||||
PANIC_I (run, XP_AWK_ENOTDELETABLE);
|
||||
}
|
||||
}
|
||||
xp_awk_map_t* map;
|
||||
|
||||
if (val->type != XP_AWK_VAL_MAP)
|
||||
PANIC_I (run, XP_AWK_ENOTDELETABLE);
|
||||
|
||||
xp_printf (XP_T("clearing map...\n"));
|
||||
map = ((xp_awk_val_map_t*)val)->map;
|
||||
if (var->type == XP_AWK_NDE_GLOBALIDX ||
|
||||
var->type == XP_AWK_NDE_LOCALIDX ||
|
||||
var->type == XP_AWK_NDE_ARGIDX)
|
||||
{
|
||||
xp_char_t* key;
|
||||
xp_awk_val_t* idx;
|
||||
int errnum;
|
||||
|
||||
xp_assert (var->idx != XP_NULL);
|
||||
|
||||
idx = __eval_expression (run, var->idx);
|
||||
if (idx == XP_NULL) return -1;
|
||||
|
||||
xp_awk_refupval (idx);
|
||||
key = xp_awk_valtostr (idx, &errnum, XP_NULL);
|
||||
xp_awk_refdownval (run, idx);
|
||||
|
||||
if (key == XP_NULL) PANIC_I (run, errnum);
|
||||
|
||||
xp_awk_map_remove (map, key);
|
||||
xp_free (key);
|
||||
}
|
||||
else
|
||||
{
|
||||
xp_printf (XP_T("**** delete NOT IMPLEMENTED not implemented for this type of variable...\n"));
|
||||
xp_awk_map_clear (map);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xp_assert (!"should never happen - wrong variable type for delete");
|
||||
PANIC_I (run, XP_AWK_EINTERNAL);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: tree.c,v 1.61 2006-06-29 15:40:30 bacon Exp $
|
||||
* $Id: tree.c,v 1.62 2006-07-01 07:57:10 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -93,8 +93,11 @@ static void __print_statements (xp_awk_nde_t* tree, int depth);
|
||||
|
||||
static void __print_tabs (int depth)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < depth; i++) xp_printf (XP_T("\t"));
|
||||
while (depth > 0)
|
||||
{
|
||||
xp_printf (XP_T("\t"));
|
||||
depth--;
|
||||
}
|
||||
}
|
||||
|
||||
static int __print_expression (xp_awk_nde_t* nde)
|
||||
@ -106,7 +109,8 @@ static int __print_expression (xp_awk_nde_t* nde)
|
||||
xp_awk_nde_t* p = ((xp_awk_nde_grp_t*)nde)->body;
|
||||
|
||||
xp_printf (XP_T("("));
|
||||
while (p != XP_NULL) {
|
||||
while (p != XP_NULL)
|
||||
{
|
||||
__print_expression (p);
|
||||
if (p->next != XP_NULL) xp_printf (XP_T(","));
|
||||
p = p->next;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: tree.h,v 1.55 2006-06-29 14:38:01 bacon Exp $
|
||||
* $Id: tree.h,v 1.56 2006-07-01 07:57:10 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XP_AWK_TREE_H_
|
||||
@ -209,7 +209,10 @@ struct xp_awk_nde_rex_t
|
||||
xp_size_t len;
|
||||
};
|
||||
|
||||
/* XP_AWK_NDE_ARG, XP_AWK_NDE_VAR, ... */
|
||||
/* XP_AWK_NDE_NAMED, XP_AWK_NDE_GLOBAL,
|
||||
* XP_AWK_NDE_LOCAL, XP_AWK_NDE_ARG
|
||||
* XP_AWK_NDE_NAMEDIDX, XP_AWK_NDE_GLOBALIDX,
|
||||
* XP_AWK_NDE_LOCALIDX, XP_AWK_NDE_ARGIDX */
|
||||
struct xp_awk_nde_var_t
|
||||
{
|
||||
XP_AWK_NDE_HDR;
|
||||
@ -218,7 +221,7 @@ struct xp_awk_nde_var_t
|
||||
xp_char_t* name;
|
||||
xp_size_t idxa;
|
||||
} id;
|
||||
xp_awk_nde_t* idx; /* XP_NULL for XXXIDX */
|
||||
xp_awk_nde_t* idx; /* XP_NULL for non-XXXXIDX */
|
||||
};
|
||||
|
||||
/* XP_AWK_NDE_BFN, XP_AWK_NDE_UFN */
|
||||
|
@ -9,8 +9,10 @@ BEGIN
|
||||
|
||||
b["xxx"] = 20;
|
||||
b["yyy"] = 30;
|
||||
b[1] = 30;
|
||||
b["2"] = 30;
|
||||
|
||||
delete a;
|
||||
delete b;
|
||||
delete b["1"];
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@ LINK32=link.exe
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "__STAND_ALONE" /FR /YX /FD /GZ /c
|
||||
# SUBTRACT CPP /FA<none>
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
Loading…
Reference in New Issue
Block a user