*** empty log message ***

This commit is contained in:
hyung-hwan 2006-06-30 16:46:34 +00:00
parent f47d3e366a
commit 5caaf4e4d9
6 changed files with 65 additions and 27 deletions

View File

@ -57,7 +57,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo # ADD LIB32 /nologo /out:"..\..\release\xpawk.lib"
!ELSEIF "$(CFG)" == "xpawk - Win32 Debug" !ELSEIF "$(CFG)" == "xpawk - Win32 Debug"
@ -87,7 +87,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=link.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo # ADD LIB32 /nologo /out:"..\..\debug\xpawk.lib"
!ELSEIF "$(CFG)" == "xpawk - Win32 Debug DLL" !ELSEIF "$(CFG)" == "xpawk - Win32 Debug DLL"
@ -120,7 +120,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:console /dll /debug /machine:I386 /def:".\awk.def" /pdbtype:sept # ADD BASE LINK32 /nologo /subsystem:console /dll /debug /machine:I386 /def:".\awk.def" /pdbtype:sept
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /subsystem:console /dll /debug /machine:I386 /def:".\awk.def" /pdbtype:sept # ADD LINK32 /nologo /subsystem:console /dll /debug /machine:I386 /def:".\awk.def" /out:"..\..\debug\xpawk.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "xpawk - Win32 Release DLL" !ELSEIF "$(CFG)" == "xpawk - Win32 Release DLL"
@ -154,7 +154,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /version:0.1 /subsystem:console /dll /machine:I386 /def:".\awk.def" # ADD BASE LINK32 /nologo /version:0.1 /subsystem:console /dll /machine:I386 /def:".\awk.def"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /version:0.1 /subsystem:console /dll /machine:I386 /def:".\awk.def" # ADD LINK32 /nologo /version:0.1 /subsystem:console /dll /machine:I386 /def:".\awk.def" /out:"..\..\release\xpawk.dll"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ENDIF !ENDIF

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.117 2006-06-30 11:31:50 bacon Exp $ * $Id: run.c,v 1.118 2006-06-30 16:46:34 bacon Exp $
*/ */
#include <xp/awk/awk_i.h> #include <xp/awk/awk_i.h>
@ -1104,17 +1104,30 @@ static int __run_delete (xp_awk_run_t* run, xp_awk_nde_delete_t* nde)
var->type == XP_AWK_NDE_LOCALIDX || var->type == XP_AWK_NDE_LOCALIDX ||
var->type == XP_AWK_NDE_ARGIDX); var->type == XP_AWK_NDE_ARGIDX);
xp_printf (XP_T("hello....... map...\n"));
if (var->type == XP_AWK_NDE_NAMED) if (var->type == XP_AWK_NDE_NAMED)
{ {
xp_awk_pair_t* pair; xp_awk_pair_t* pair;
pair = xp_awk_map_get (&run->named, var->id.name); pair = xp_awk_map_get (&run->named, var->id.name);
if (pair != XP_NULL)
{
if (pair == XP_NULL) if (pair == XP_NULL)
{ {
/* value not set */ xp_awk_val_t* tmp;
// TODO: create a map here...
/* 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);
if (xp_awk_map_put (&run->named, var->id.name, tmp) == XP_NULL)
{
xp_awk_refupval (tmp);
xp_awk_refdownval (run, tmp);
PANIC_I (run, XP_AWK_ENOMEM);
}
xp_awk_refupval (tmp);
} }
else else
{ {
@ -1123,7 +1136,9 @@ static int __run_delete (xp_awk_run_t* run, xp_awk_nde_delete_t* nde)
xp_assert (val != XP_NULL); xp_assert (val != XP_NULL);
if (val->type == XP_AWK_VAL_MAP) if (val->type == XP_AWK_VAL_MAP)
{ {
xp_printf (XP_T("clearing map...\n"));
xp_awk_map_clear (((xp_awk_val_map_t*)val)->map); xp_awk_map_clear (((xp_awk_val_map_t*)val)->map);
/* should not ismply clear it... */
} }
else else
{ {
@ -1131,6 +1146,27 @@ static int __run_delete (xp_awk_run_t* run, xp_awk_nde_delete_t* nde)
} }
} }
} }
else if (var->type == XP_AWK_NDE_GLOBAL)
{
xp_awk_val_t* val;
val = STACK_GLOBAL (run,var->id.idxa);
if (val == XP_NULL)
{
/* TODO: */
}
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 else
{ {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: val.c,v 1.33 2006-06-28 08:56:59 bacon Exp $ * $Id: val.c,v 1.34 2006-06-30 16:46:34 bacon Exp $
*/ */
#include <xp/awk/awk_i.h> #include <xp/awk/awk_i.h>
@ -385,7 +385,7 @@ xp_char_t* xp_awk_valtostr (xp_awk_val_t* v, int* errnum, xp_str_t* buf)
if (buf == XP_NULL) if (buf == XP_NULL)
{ {
tmp = xp_malloc (len + 1 * xp_sizeof(xp_char_t)); tmp = xp_malloc ((len + 1) * xp_sizeof(xp_char_t));
if (tmp == XP_NULL) if (tmp == XP_NULL)
{ {
*errnum = XP_AWK_ENOMEM; *errnum = XP_AWK_ENOMEM;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: val.h,v 1.25 2006-06-26 15:09:28 bacon Exp $ * $Id: val.h,v 1.26 2006-06-30 16:46:34 bacon Exp $
*/ */
#ifndef _XP_AWK_VAL_H_ #ifndef _XP_AWK_VAL_H_
@ -105,6 +105,7 @@ xp_awk_val_t* xp_awk_makerexval (const xp_char_t* str, xp_size_t len);
xp_awk_val_t* xp_awk_makemapval (xp_awk_run_t* run); xp_awk_val_t* xp_awk_makemapval (xp_awk_run_t* run);
xp_bool_t xp_awk_isbuiltinval (xp_awk_val_t* val); xp_bool_t xp_awk_isbuiltinval (xp_awk_val_t* val);
void xp_awk_freeval (xp_awk_run_t* run, xp_awk_val_t* val, xp_bool_t cache); void xp_awk_freeval (xp_awk_run_t* run, xp_awk_val_t* val, xp_bool_t cache);
void xp_awk_refupval (xp_awk_val_t* val); void xp_awk_refupval (xp_awk_val_t* val);
void xp_awk_refdownval (xp_awk_run_t* run, xp_awk_val_t* val); void xp_awk_refdownval (xp_awk_run_t* run, xp_awk_val_t* val);

View File

@ -1,8 +1,9 @@
//global a;
BEGIN BEGIN
{ {
a = 20; //a = 20;
/*a[1] = 20; a[1] = 20;
a[2] = 30;*/ a[2] = 30;
delete a; delete a;
} }

View File

@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 xpawk.lib /nologo /subsystem:console /machine:I386 /out:"Release/awk.exe" /libpath:"..\..\awk\release" # ADD LINK32 xpawk.lib /nologo /subsystem:console /machine:I386 /out:"..\..\..\release\awk.exe" /libpath:"..\..\awk\release"
!ELSEIF "$(CFG)" == "xptestawk - Win32 Debug" !ELSEIF "$(CFG)" == "xptestawk - Win32 Debug"
@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 xpawk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/awk.exe" /pdbtype:sept /libpath:"..\..\awk\debug" # ADD LINK32 xpawk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\..\debug\awk.exe" /pdbtype:sept /libpath:"..\..\awk\debug"
!ENDIF !ENDIF