enhanced awk error codes for more consistency

This commit is contained in:
hyung-hwan 2013-04-19 15:06:52 +00:00
parent 3d813a1bf1
commit e01ac6bbac
15 changed files with 369 additions and 240 deletions

View File

@ -346,7 +346,9 @@ enum qse_awk_nde_type_t
/* keep this order for the following items otherwise, you may have /* keep this order for the following items otherwise, you may have
* to change eval_incpre and eval_incpst in run.c as well as * to change eval_incpre and eval_incpst in run.c as well as
* QSE_AWK_VAL_REF_XXX in qse_awk_val_ref_t */ * QSE_AWK_VAL_REF_XXX in qse_awk_val_ref_t. also do_assignment_map()
* in run.c converts QSE_AWK_NDE_XXXIDX to QSE_AWK_NDE_XXX by
* decrementing by 4. */
QSE_AWK_NDE_NAMED, QSE_AWK_NDE_NAMED,
QSE_AWK_NDE_GBL, QSE_AWK_NDE_GBL,
QSE_AWK_NDE_LCL, QSE_AWK_NDE_LCL,
@ -1129,7 +1131,7 @@ enum qse_awk_trait_t
QSE_AWK_MODERN = QSE_AWK_MODERN =
QSE_AWK_CLASSIC | QSE_AWK_FLEXMAP | QSE_AWK_CLASSIC | QSE_AWK_FLEXMAP |
QSE_AWK_RWPIPE | QSE_AWK_TOLERANT | QSE_AWK_NEXTOFILE | QSE_AWK_NCMPONSTR QSE_AWK_RWPIPE | QSE_AWK_TOLERANT | QSE_AWK_NEXTOFILE /*| QSE_AWK_NCMPONSTR*/
}; };
typedef enum qse_awk_trait_t qse_awk_trait_t; typedef enum qse_awk_trait_t qse_awk_trait_t;
@ -1231,19 +1233,20 @@ enum qse_awk_errnum_t
QSE_AWK_EARGTF, /**< too few arguments */ QSE_AWK_EARGTF, /**< too few arguments */
QSE_AWK_EARGTM, /**< too many arguments */ QSE_AWK_EARGTM, /**< too many arguments */
QSE_AWK_EFUNNF, /**< function '${0}' not found */ QSE_AWK_EFUNNF, /**< function '${0}' not found */
QSE_AWK_ENOTIDX, /**< not indexable */
QSE_AWK_ENOTDEL, /**< '${0}' not deletable */ QSE_AWK_ENOTDEL, /**< '${0}' not deletable */
QSE_AWK_ENOTMAP, /**< value not a map */ QSE_AWK_ENOTMAP, /**< value not a map */
QSE_AWK_ENOTMAPIN, /**< right-hand side of 'in' not a map */ QSE_AWK_ENOTMAPIN, /**< right-hand side of 'in' not a map */
QSE_AWK_ENOTMAPNILIN, /**< right-hand side of 'in' not a map nor nil */ QSE_AWK_ENOTMAPNILIN, /**< right-hand side of 'in' not a map nor nil */
QSE_AWK_ENOTREF, /**< value not referenceable */ QSE_AWK_ENOTREF, /**< value not referenceable */
QSE_AWK_EIDXVALMAP, /**< indexed value cannot be a map */ QSE_AWK_EMAPRET, /**< map cannot be returned */
QSE_AWK_EPOSVALMAP, /**< positional cannot be a map */ QSE_AWK_EMAPTOPOS, /**< map cannot be assigned to a positional */
QSE_AWK_EMAPNA, /**< map cannot be assigned to variable */ QSE_AWK_EMAPTOIDX, /**< map cannot be assigned to an indexed variable */
QSE_AWK_EMAPNRA, /**< map '${0}' cannot be reassigned */ QSE_AWK_EMAPTONVAR, /**< map cannot be assigned to an variable '${0}' */
QSE_AWK_EMAPUR, /**< map unreturnable */
QSE_AWK_EMAPTOSCALAR, /**< cannot change a map to a scalar value */ QSE_AWK_EMAPTOSCALAR, /**< cannot change a map to a scalar value */
QSE_AWK_ESCALARTOMAP, /**< cannot change a scalar value to a map */ QSE_AWK_ESCALARTOMAP, /**< cannot change a scalar to a map */
QSE_AWK_ENMAPTOMAP, /**< cannot change a map '${0}' to another map */
QSE_AWK_ENMAPTOSCALAR, /**< cannot change a map '${0}' to a scalar */
QSE_AWK_ENSCALARTOMAP, /**< cannot change a scalar '${0}' to a map */
QSE_AWK_EVALTOSTR, /**< invalid value to convert to a string */ QSE_AWK_EVALTOSTR, /**< invalid value to convert to a string */
QSE_AWK_EVALTONUM, /**< invalid value to convert to a number */ QSE_AWK_EVALTONUM, /**< invalid value to convert to a number */
QSE_AWK_EVALTOCHR, /**< invalid value to convert to a character */ QSE_AWK_EVALTOCHR, /**< invalid value to convert to a character */

View File

@ -112,19 +112,20 @@ const qse_char_t* qse_awk_dflerrstr (const qse_awk_t* awk, qse_awk_errnum_t errn
QSE_T("too few arguments"), QSE_T("too few arguments"),
QSE_T("too many arguments"), QSE_T("too many arguments"),
QSE_T("function '${0}' not found"), QSE_T("function '${0}' not found"),
QSE_T("not indexable"),
QSE_T("'${0}' not deletable"), QSE_T("'${0}' not deletable"),
QSE_T("value not a map"), QSE_T("value not a map"),
QSE_T("right-hand side of the 'in' operator not a map"), QSE_T("right-hand side of the 'in' operator not a map"),
QSE_T("right-hand side of the 'in' operator not a map nor nil"), QSE_T("right-hand side of the 'in' operator not a map nor nil"),
QSE_T("value not referenceable"), QSE_T("value not referenceable"),
QSE_T("indexed variable cannot be assigned a map"), QSE_T("cannot return a map"), /* EMAPRET */
QSE_T("positional cannot be assigned a map"), QSE_T("cannot assign a map to a positional"), /* EMAPTOPOS */
QSE_T("map cannot be assigned to variable"), QSE_T("cannot assign a map to an indexed variable"),/* EMAPTOIDX */
QSE_T("map '${0}' cannot be reassigned"), QSE_T("cannot assign a map to a variable '${0}'"), /* EMAPTONVAR */
QSE_T("map cannot be returned"), QSE_T("cannot change a map to a scalar"), /* EMAPTOSCALAR */
QSE_T("cannot change a map to a scalar value"), QSE_T("cannot change a scalar to a map"), /* ESCALARTOMAP */
QSE_T("cannot change a scalar value to a map"), QSE_T("cannot change a map '${0}' to another map"),/* ENMAPTOMAP */
QSE_T("cannot change a map '${0}' to a scalar"), /* ENMAPTOSCALAR */
QSE_T("cannot change a scalar '${0}' to a map"), /* ENSCALARTOMAP */
QSE_T("invalid value to convert to a string"), QSE_T("invalid value to convert to a string"),
QSE_T("invalid value to convert to a number"), QSE_T("invalid value to convert to a number"),
QSE_T("invalid value to a character"), QSE_T("invalid value to a character"),

View File

@ -35,7 +35,8 @@ enum
DIR_ENOMEM, DIR_ENOMEM,
DIR_EINVAL, DIR_EINVAL,
DIR_EACCES, DIR_EACCES,
DIR_ENOENT DIR_ENOENT,
DIR_EMAPTOSCALAR
}; };
struct dir_node_t struct dir_node_t
@ -96,6 +97,8 @@ static int awk_err_to_errnum (qse_awk_errnum_t num)
return DIR_EACCES; return DIR_EACCES;
case QSE_AWK_ENOENT: case QSE_AWK_ENOENT:
return DIR_ENOENT; return DIR_ENOENT;
case QSE_AWK_EMAPTOSCALAR:
return DIR_EMAPTOSCALAR;
default: default:
return DIR_EOTHER; return DIR_EOTHER;
} }
@ -338,6 +341,7 @@ static qse_char_t* errmsg[] =
QSE_T("invalid data"), QSE_T("invalid data"),
QSE_T("access denied"), QSE_T("access denied"),
QSE_T("no entry"), QSE_T("no entry"),
QSE_T("cannot change a map to a scalar"),
QSE_T("unknown error") QSE_T("unknown error")
}; };

View File

@ -6595,6 +6595,12 @@ int qse_awk_putsrcstrn (
# include "mod-uci.h" # include "mod-uci.h"
#endif #endif
/*
* if modules are linked statically into the main awk module,
* this table is used to find the entry point of the modules.
* you must update this table if you add more modules
*/
static struct static struct
{ {
qse_char_t* modname; qse_char_t* modname;

View File

@ -132,9 +132,9 @@ static qse_awk_val_t* eval_assignment (
qse_awk_rtx_t* run, qse_awk_nde_t* nde); qse_awk_rtx_t* run, qse_awk_nde_t* nde);
static qse_awk_val_t* do_assignment ( static qse_awk_val_t* do_assignment (
qse_awk_rtx_t* run, qse_awk_nde_t* var, qse_awk_val_t* val); qse_awk_rtx_t* run, qse_awk_nde_t* var, qse_awk_val_t* val);
static qse_awk_val_t* do_assignment_scalar ( static qse_awk_val_t* do_assignment_nonidx (
qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val); qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val);
static qse_awk_val_t* do_assignment_map ( static qse_awk_val_t* do_assignment_idx (
qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val); qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val);
static qse_awk_val_t* do_assignment_pos ( static qse_awk_val_t* do_assignment_pos (
qse_awk_rtx_t* run, qse_awk_nde_pos_t* pos, qse_awk_val_t* val); qse_awk_rtx_t* run, qse_awk_nde_pos_t* pos, qse_awk_val_t* val);
@ -301,29 +301,50 @@ const qse_xstr_t* qse_awk_rtx_getsubsep (qse_awk_rtx_t* run)
* require special treatment. */ * require special treatment. */
static int set_global ( static int set_global (
qse_awk_rtx_t* rtx, int idx, qse_awk_rtx_t* rtx, int idx,
qse_awk_nde_var_t* var, qse_awk_val_t* val) qse_awk_nde_var_t* var, qse_awk_val_t* val, int assign)
{ {
qse_awk_val_t* old; qse_awk_val_t* old;
qse_awk_rtx_ecb_t* ecb; qse_awk_rtx_ecb_t* ecb;
old = RTX_STACK_GBL (rtx, idx); old = RTX_STACK_GBL (rtx, idx);
if (old == val) return 0; /* the old value is the same as the new value. nothing to do */
if (!(rtx->awk->opt.trait & QSE_AWK_FLEXMAP)) if (!(rtx->awk->opt.trait & QSE_AWK_FLEXMAP))
{ {
qse_awk_errnum_t errnum = QSE_AWK_ENOERR; qse_awk_errnum_t errnum = QSE_AWK_ENOERR;
if (old->type == QSE_AWK_VAL_MAP && val->type != QSE_AWK_VAL_MAP)
errnum = QSE_AWK_EMAPNRA;
if (val->type == QSE_AWK_VAL_MAP) if (val->type == QSE_AWK_VAL_MAP)
{ {
if (old->type != QSE_AWK_VAL_NIL) if (old->type == QSE_AWK_VAL_NIL)
errnum = QSE_AWK_EMAPNA; {
/* a nil valul can be overridden with any values */
/* ok. no error */
}
else if (!assign && old->type == QSE_AWK_VAL_MAP)
{
/* when both are maps, how should this operation be
* interpreted?
*
* is it an assignment?
* old = new
*
* or is it to delete all elements in the array
* and add new items?
* for (i in old) delete old[i];
* for (i in new) old[i] = new[i];
*
* i interpret this operation as the latter.
*/
/* ok. no error */
}
else
{
errnum = QSE_AWK_ENSCALARTOMAP;
}
} }
else else
{ {
if (old->type == QSE_AWK_VAL_MAP) errnum = QSE_AWK_EMAPNRA; if (old->type == QSE_AWK_VAL_MAP) errnum = QSE_AWK_ENMAPTOSCALAR;
} }
if (errnum != QSE_AWK_ENOERR) if (errnum != QSE_AWK_ENOERR)
@ -334,12 +355,7 @@ static int set_global (
if (var) if (var)
{ {
/* global variable */ /* global variable */
SETERR_ARGX_LOC ( SETERR_ARGX_LOC (rtx, errnum, xstr_to_cstr(&var->id.name), &var->loc);
rtx,
errnum,
xstr_to_cstr(&var->id.name),
&var->loc
);
} }
else else
{ {
@ -357,15 +373,30 @@ static int set_global (
{ {
if (idx >= QSE_AWK_MIN_GBL_ID && idx <= QSE_AWK_MAX_GBL_ID) if (idx >= QSE_AWK_MIN_GBL_ID && idx <= QSE_AWK_MAX_GBL_ID)
{ {
/* short-circuit check block to prevent the basic built-in variables /* short-circuit check block to prevent the basic built-in
* from being assigned a map. if you happen to add one and if that's * variables from being assigned a map. if you happen to add
* allowed to be a map, you may have to change the condition here. */ * one and if that's allowed to be a map, you may have to
* change the condition here. */
/* TODO: use global variable attribute. can it be a map? can it be a scalar? is it read-only???? */ /* TODO: use global variable attribute. can it be a map? can it be a scalar? is it read-only???? */
SETERR_COD (rtx, QSE_AWK_ESCALARTOMAP);
qse_cstr_t ea;
ea.ptr = qse_awk_getgblname (rtx->awk, idx, &ea.len);
SETERR_ARGX (rtx, QSE_AWK_ENSCALARTOMAP, &ea);
return -1; return -1;
} }
} }
if (old == val)
{
/* if the old value is the same as the new value, don't take any actions.
* note that several inspections have been performed before this check,
* mainly for consistency. anyway, this condition can be met if you execute
* a statement like 'ARGV=ARGV'. */
return 0;
}
/* perform actual assignment or assignment-like operation */
switch (idx) switch (idx)
{ {
case QSE_AWK_GBL_CONVFMT: case QSE_AWK_GBL_CONVFMT:
@ -652,7 +683,7 @@ QSE_INLINE int qse_awk_rtx_setgbl (
qse_awk_rtx_t* rtx, int id, qse_awk_val_t* val) qse_awk_rtx_t* rtx, int id, qse_awk_val_t* val)
{ {
QSE_ASSERT (id >= 0 && id < (int)QSE_LDA_SIZE(rtx->awk->parse.gbls)); QSE_ASSERT (id >= 0 && id < (int)QSE_LDA_SIZE(rtx->awk->parse.gbls));
return set_global (rtx, id, QSE_NULL, val); return set_global (rtx, id, QSE_NULL, val, 0);
} }
int qse_awk_rtx_setfilename ( int qse_awk_rtx_setfilename (
@ -2337,7 +2368,7 @@ static int run_return (qse_awk_rtx_t* run, qse_awk_nde_return_t* nde)
/* cannot return a map */ /* cannot return a map */
qse_awk_rtx_refupval (run, val); qse_awk_rtx_refupval (run, val);
qse_awk_rtx_refdownval (run, val); qse_awk_rtx_refdownval (run, val);
SETERR_LOC (run, QSE_AWK_EMAPUR, &nde->loc); SETERR_LOC (run, QSE_AWK_EMAPRET, &nde->loc);
return -1; return -1;
} }
} }
@ -2739,12 +2770,8 @@ static int run_delete (qse_awk_rtx_t* rtx, qse_awk_nde_delete_t* nde)
} }
static int run_reset (qse_awk_rtx_t* rtx, qse_awk_nde_reset_t* nde) static int reset_variable (qse_awk_rtx_t* rtx, qse_awk_nde_var_t* var)
{ {
qse_awk_nde_var_t* var;
var = (qse_awk_nde_var_t*) nde->var;
switch (var->type) switch (var->type)
{ {
case QSE_AWK_NDE_NAMED: case QSE_AWK_NDE_NAMED:
@ -2810,6 +2837,11 @@ static int run_reset (qse_awk_rtx_t* rtx, qse_awk_nde_reset_t* nde)
} }
} }
static int run_reset (qse_awk_rtx_t* rtx, qse_awk_nde_reset_t* nde)
{
return reset_variable (rtx, (qse_awk_nde_var_t*)nde->var);
}
static int run_print (qse_awk_rtx_t* rtx, qse_awk_nde_print_t* nde) static int run_print (qse_awk_rtx_t* rtx, qse_awk_nde_print_t* nde)
{ {
qse_char_t* out = QSE_NULL; qse_char_t* out = QSE_NULL;
@ -3422,66 +3454,59 @@ static qse_awk_val_t* eval_assignment (qse_awk_rtx_t* run, qse_awk_nde_t* nde)
} }
static qse_awk_val_t* do_assignment ( static qse_awk_val_t* do_assignment (
qse_awk_rtx_t* run, qse_awk_nde_t* var, qse_awk_val_t* val) qse_awk_rtx_t* rtx, qse_awk_nde_t* var, qse_awk_val_t* val)
{ {
qse_awk_val_t* ret; qse_awk_val_t* ret;
qse_awk_errnum_t errnum; qse_awk_errnum_t errnum;
if (var->type == QSE_AWK_NDE_NAMED || switch (var->type)
var->type == QSE_AWK_NDE_GBL ||
var->type == QSE_AWK_NDE_LCL ||
var->type == QSE_AWK_NDE_ARG)
{ {
if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP)) case QSE_AWK_NDE_NAMED:
{ case QSE_AWK_NDE_GBL:
/* a map value cannot be assigned to another variable */ case QSE_AWK_NDE_LCL:
case QSE_AWK_NDE_ARG:
ret = do_assignment_nonidx (rtx, (qse_awk_nde_var_t*)var, val);
break;
case QSE_AWK_NDE_NAMEDIDX:
case QSE_AWK_NDE_GBLIDX:
case QSE_AWK_NDE_LCLIDX:
case QSE_AWK_NDE_ARGIDX:
if (val->type == QSE_AWK_VAL_MAP) if (val->type == QSE_AWK_VAL_MAP)
{ {
errnum = QSE_AWK_EMAPNA; /* a map cannot become a member of a map */
errnum = QSE_AWK_EMAPTOIDX;
goto exit_on_error; goto exit_on_error;
} }
}
ret = do_assignment_scalar (run, (qse_awk_nde_var_t*)var, val); ret = do_assignment_idx (rtx, (qse_awk_nde_var_t*)var, val);
} break;
else if (var->type == QSE_AWK_NDE_NAMEDIDX ||
var->type == QSE_AWK_NDE_GBLIDX ||
var->type == QSE_AWK_NDE_LCLIDX ||
var->type == QSE_AWK_NDE_ARGIDX)
{
if (val->type == QSE_AWK_VAL_MAP)
{
errnum = QSE_AWK_EMAPNA;
goto exit_on_error;
}
ret = do_assignment_map (run, (qse_awk_nde_var_t*)var, val); case QSE_AWK_NDE_POS:
} if (val->type == QSE_AWK_VAL_MAP)
else if (var->type == QSE_AWK_NDE_POS) {
{ /* a map cannot be assigned to a positional */
if (val->type == QSE_AWK_VAL_MAP) errnum = QSE_AWK_EMAPTOPOS;
{ goto exit_on_error;
errnum = QSE_AWK_EMAPNA; }
goto exit_on_error;
}
ret = do_assignment_pos (run, (qse_awk_nde_pos_t*)var, val); ret = do_assignment_pos (rtx, (qse_awk_nde_pos_t*)var, val);
} break;
else
{ default:
QSE_ASSERT (!"should never happen - invalid variable type"); QSE_ASSERT (!"should never happen - invalid variable type");
errnum = QSE_AWK_EINTERN; errnum = QSE_AWK_EINTERN;
goto exit_on_error; goto exit_on_error;
} }
return ret; return ret;
exit_on_error: exit_on_error:
SETERR_LOC (run, errnum, &var->loc); SETERR_LOC (rtx, errnum, &var->loc);
return QSE_NULL; return QSE_NULL;
} }
static qse_awk_val_t* do_assignment_scalar ( static qse_awk_val_t* do_assignment_nonidx (
qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val) qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val)
{ {
QSE_ASSERT ( QSE_ASSERT (
@ -3493,29 +3518,35 @@ static qse_awk_val_t* do_assignment_scalar (
QSE_ASSERT (var->idx == QSE_NULL); QSE_ASSERT (var->idx == QSE_NULL);
QSE_ASSERT (
(run->awk->opt.trait & QSE_AWK_FLEXMAP) ||
val->type != QSE_AWK_VAL_MAP);
switch (var->type) switch (var->type)
{ {
case QSE_AWK_NDE_NAMED: case QSE_AWK_NDE_NAMED:
{ {
qse_htb_pair_t* pair; qse_htb_pair_t* pair;
pair = qse_htb_search ( pair = qse_htb_search (run->named, var->id.name.ptr, var->id.name.len);
run->named, var->id.name.ptr, var->id.name.len);
if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP) && if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP))
pair && ((qse_awk_val_t*)QSE_HTB_VPTR(pair))->type == QSE_AWK_VAL_MAP)
{ {
/* once a variable becomes a map, if (pair && ((qse_awk_val_t*)QSE_HTB_VPTR(pair))->type == QSE_AWK_VAL_MAP)
* it cannot be changed to a scalar variable */ {
SETERR_ARGX_LOC ( /* old value is a map - it can only be accessed through indexing. */
run, QSE_AWK_EMAPNRA, qse_awk_errnum_t errnum;
xstr_to_cstr(&var->id.name), &var->loc); errnum = (val->type == QSE_AWK_VAL_MAP)?
return QSE_NULL; QSE_AWK_ENMAPTOMAP: QSE_AWK_ENMAPTOSCALAR;
SETERR_ARGX_LOC (run, errnum, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
else if (val->type == QSE_AWK_VAL_MAP)
{
/* old value is not a map but a new value is a map.
* a map cannot be assigned to a variable if FLEXMAP is off. */
SETERR_ARGX_LOC (run, QSE_AWK_EMAPTONVAR, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
} }
if (qse_htb_upsert (run->named, if (qse_htb_upsert (run->named,
var->id.name.ptr, var->id.name.len, val, 0) == QSE_NULL) var->id.name.ptr, var->id.name.len, val, 0) == QSE_NULL)
{ {
@ -3529,7 +3560,7 @@ static qse_awk_val_t* do_assignment_scalar (
case QSE_AWK_NDE_GBL: case QSE_AWK_NDE_GBL:
{ {
if (set_global (run, var->id.idxa, var, val) == -1) if (set_global (run, var->id.idxa, var, val, 1) == -1)
{ {
ADJERR_LOC (run, &var->loc); ADJERR_LOC (run, &var->loc);
return QSE_NULL; return QSE_NULL;
@ -3540,16 +3571,27 @@ static qse_awk_val_t* do_assignment_scalar (
case QSE_AWK_NDE_LCL: case QSE_AWK_NDE_LCL:
{ {
qse_awk_val_t* old = RTX_STACK_LCL(run,var->id.idxa); qse_awk_val_t* old = RTX_STACK_LCL(run,var->id.idxa);
if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP) && old->type == QSE_AWK_VAL_MAP)
{ if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP))
/* once the variable becomes a map, {
* it cannot be changed to a scalar variable */ if (old->type == QSE_AWK_VAL_MAP)
SETERR_ARGX_LOC ( {
run, QSE_AWK_EMAPNRA, /* old value is a map - it can only be accessed through indexing. */
xstr_to_cstr(&var->id.name), &var->loc); qse_awk_errnum_t errnum;
return QSE_NULL; errnum = (val->type == QSE_AWK_VAL_MAP)?
QSE_AWK_ENMAPTOMAP: QSE_AWK_ENMAPTOSCALAR;
SETERR_ARGX_LOC (run, errnum, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
else if (val->type == QSE_AWK_VAL_MAP)
{
/* old value is not a map but a new value is a map.
* a map cannot be assigned to a variable if FLEXMAP is off. */
SETERR_ARGX_LOC (run, QSE_AWK_EMAPTONVAR, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
} }
qse_awk_rtx_refdownval (run, old); qse_awk_rtx_refdownval (run, old);
RTX_STACK_LCL(run,var->id.idxa) = val; RTX_STACK_LCL(run,var->id.idxa) = val;
qse_awk_rtx_refupval (run, val); qse_awk_rtx_refupval (run, val);
@ -3559,14 +3601,25 @@ static qse_awk_val_t* do_assignment_scalar (
case QSE_AWK_NDE_ARG: case QSE_AWK_NDE_ARG:
{ {
qse_awk_val_t* old = RTX_STACK_ARG(run,var->id.idxa); qse_awk_val_t* old = RTX_STACK_ARG(run,var->id.idxa);
if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP) && old->type == QSE_AWK_VAL_MAP)
{ if (!(run->awk->opt.trait & QSE_AWK_FLEXMAP))
/* once the variable becomes a map, {
* it cannot be changed to a scalar variable */ if (old->type == QSE_AWK_VAL_MAP)
SETERR_ARGX_LOC ( {
run, QSE_AWK_EMAPNRA, /* old value is a map - it can only be accessed through indexing. */
xstr_to_cstr(&var->id.name), &var->loc); qse_awk_errnum_t errnum;
return QSE_NULL; errnum = (val->type == QSE_AWK_VAL_MAP)?
QSE_AWK_ENMAPTOMAP: QSE_AWK_ENMAPTOSCALAR;
SETERR_ARGX_LOC (run, errnum, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
else if (val->type == QSE_AWK_VAL_MAP)
{
/* old value is not a map but a new value is a map.
* a map cannot be assigned to a variable if FLEXMAP is off. */
SETERR_ARGX_LOC (run, QSE_AWK_EMAPTONVAR, xstr_to_cstr(&var->id.name), &var->loc);
return QSE_NULL;
}
} }
qse_awk_rtx_refdownval (run, old); qse_awk_rtx_refdownval (run, old);
@ -3580,8 +3633,8 @@ static qse_awk_val_t* do_assignment_scalar (
return val; return val;
} }
static qse_awk_val_t* do_assignment_map ( static qse_awk_val_t* do_assignment_idx (
qse_awk_rtx_t* run, qse_awk_nde_var_t* var, qse_awk_val_t* val) qse_awk_rtx_t* rtx, qse_awk_nde_var_t* var, qse_awk_val_t* val)
{ {
qse_awk_val_map_t* map; qse_awk_val_map_t* map;
qse_char_t* str; qse_char_t* str;
@ -3595,33 +3648,42 @@ static qse_awk_val_t* do_assignment_map (
var->type == QSE_AWK_NDE_ARGIDX) && var->idx != QSE_NULL); var->type == QSE_AWK_NDE_ARGIDX) && var->idx != QSE_NULL);
QSE_ASSERT (val->type != QSE_AWK_VAL_MAP); QSE_ASSERT (val->type != QSE_AWK_VAL_MAP);
if (var->type == QSE_AWK_NDE_NAMEDIDX) retry:
switch (var->type)
{ {
qse_htb_pair_t* pair; case QSE_AWK_NDE_NAMEDIDX:
pair = qse_htb_search ( {
run->named, var->id.name.ptr, var->id.name.len); qse_htb_pair_t* pair;
map = (pair == QSE_NULL)? pair = qse_htb_search (
(qse_awk_val_map_t*)qse_awk_val_nil: rtx->named, var->id.name.ptr, var->id.name.len);
(qse_awk_val_map_t*)QSE_HTB_VPTR(pair); map = (pair == QSE_NULL)?
} (qse_awk_val_map_t*)qse_awk_val_nil:
else (qse_awk_val_map_t*)QSE_HTB_VPTR(pair);
{ break;
map = (var->type == QSE_AWK_NDE_GBLIDX)? }
(qse_awk_val_map_t*)RTX_STACK_GBL(run,var->id.idxa):
(var->type == QSE_AWK_NDE_LCLIDX)? case QSE_AWK_NDE_GBLIDX:
(qse_awk_val_map_t*)RTX_STACK_LCL(run,var->id.idxa): map = (qse_awk_val_map_t*)RTX_STACK_GBL(rtx,var->id.idxa);
(qse_awk_val_map_t*)RTX_STACK_ARG(run,var->id.idxa); break;
case QSE_AWK_NDE_LCLIDX:
map = (qse_awk_val_map_t*)RTX_STACK_LCL(rtx,var->id.idxa);
break;
default: /* QSE_AWK_NDE_ARGIDX */
map = (qse_awk_val_map_t*)RTX_STACK_ARG(rtx,var->id.idxa);
break;
} }
if (map->type == QSE_AWK_VAL_NIL) if (map->type == QSE_AWK_VAL_NIL)
{ {
/* the map is not initialized yet */
qse_awk_val_t* tmp; qse_awk_val_t* tmp;
tmp = qse_awk_rtx_makemapval (run); /* the map is not initialized yet */
tmp = qse_awk_rtx_makemapval (rtx);
if (tmp == QSE_NULL) if (tmp == QSE_NULL)
{ {
ADJERR_LOC (run, &var->loc); ADJERR_LOC (rtx, &var->loc);
return QSE_NULL; return QSE_NULL;
} }
@ -3632,11 +3694,11 @@ static qse_awk_val_t* do_assignment_map (
/* doesn't have to decrease the reference count /* doesn't have to decrease the reference count
* of the previous value here as it is done by * of the previous value here as it is done by
* qse_htb_upsert */ * qse_htb_upsert */
qse_awk_rtx_refupval (run, tmp); qse_awk_rtx_refupval (rtx, tmp);
if (qse_htb_upsert (run->named, var->id.name.ptr, var->id.name.len, tmp, 0) == QSE_NULL) if (qse_htb_upsert (rtx->named, var->id.name.ptr, var->id.name.len, tmp, 0) == QSE_NULL)
{ {
qse_awk_rtx_refdownval (run, tmp); qse_awk_rtx_refdownval (rtx, tmp);
SETERR_LOC (run, QSE_AWK_ENOMEM, &var->loc); SETERR_LOC (rtx, QSE_AWK_ENOMEM, &var->loc);
return QSE_NULL; return QSE_NULL;
} }
@ -3647,41 +3709,61 @@ static qse_awk_val_t* do_assignment_map (
{ {
int x; int x;
qse_awk_rtx_refupval (run, tmp); qse_awk_rtx_refupval (rtx, tmp);
x = qse_awk_rtx_setgbl (run, (int)var->id.idxa, tmp); x = qse_awk_rtx_setgbl (rtx, (int)var->id.idxa, tmp);
qse_awk_rtx_refdownval (run, tmp); qse_awk_rtx_refdownval (rtx, tmp);
if (x <= -1) if (x <= -1)
{ {
ADJERR_LOC (run, &var->loc); ADJERR_LOC (rtx, &var->loc);
return QSE_NULL; return QSE_NULL;
} }
break; break;
} }
case QSE_AWK_NDE_LCLIDX: case QSE_AWK_NDE_LCLIDX:
qse_awk_rtx_refdownval (run, (qse_awk_val_t*)map); qse_awk_rtx_refdownval (rtx, (qse_awk_val_t*)map);
RTX_STACK_LCL(run,var->id.idxa) = tmp; RTX_STACK_LCL(rtx,var->id.idxa) = tmp;
qse_awk_rtx_refupval (run, tmp); qse_awk_rtx_refupval (rtx, tmp);
break; break;
default: /* QSE_AWK_NDE_ARGIDX */ default: /* QSE_AWK_NDE_ARGIDX */
qse_awk_rtx_refdownval (run, (qse_awk_val_t*)map); qse_awk_rtx_refdownval (rtx, (qse_awk_val_t*)map);
RTX_STACK_ARG(run,var->id.idxa) = tmp; RTX_STACK_ARG(rtx,var->id.idxa) = tmp;
qse_awk_rtx_refupval (run, tmp); qse_awk_rtx_refupval (rtx, tmp);
break; break;
} }
map = (qse_awk_val_map_t*) tmp; map = (qse_awk_val_map_t*)tmp;
} }
else if (map->type != QSE_AWK_VAL_MAP) else if (map->type != QSE_AWK_VAL_MAP)
{ {
/* variable assigned is not a map */ if (rtx->awk->opt.trait & QSE_AWK_FLEXMAP)
SETERR_LOC (run, QSE_AWK_ENOTIDX, &var->loc); {
return QSE_NULL; /* if FLEXMAP is on, you can switch a scalar value to a map */
qse_awk_nde_var_t fake;
/* create a fake non-indexed variable node */
fake = *var;
/* NOTE: type conversion by decrementing by 4 is
* dependent on the qse_awk_nde_type_t
* enumerators defined in <qse/awk/awk.h> */
fake.type = var->type - 4;
fake.idx = QSE_NULL;
reset_variable (rtx, &fake);
goto retry;
}
else
{
/* you can't manipulate a variable pointing to
* a scalar value with an index if FLEXMAP is off. */
SETERR_LOC (rtx, QSE_AWK_ESCALARTOMAP, &var->loc);
return QSE_NULL;
}
} }
len = QSE_COUNTOF(idxbuf); len = QSE_COUNTOF(idxbuf);
str = idxnde_to_str (run, var->idx, idxbuf, &len); str = idxnde_to_str (rtx, var->idx, idxbuf, &len);
if (str == QSE_NULL) return QSE_NULL; if (str == QSE_NULL) return QSE_NULL;
#ifdef DEBUG_RUN #ifdef DEBUG_RUN
@ -3691,13 +3773,13 @@ static qse_awk_val_t* do_assignment_map (
if (qse_htb_upsert (map->map, str, len, val, 0) == QSE_NULL) if (qse_htb_upsert (map->map, str, len, val, 0) == QSE_NULL)
{ {
if (str != idxbuf) QSE_AWK_FREE (run->awk, str); if (str != idxbuf) QSE_AWK_FREE (rtx->awk, str);
SETERR_LOC (run, QSE_AWK_ENOMEM, &var->loc); SETERR_LOC (rtx, QSE_AWK_ENOMEM, &var->loc);
return QSE_NULL; return QSE_NULL;
} }
if (str != idxbuf) QSE_AWK_FREE (run->awk, str); if (str != idxbuf) QSE_AWK_FREE (rtx->awk, str);
qse_awk_rtx_refupval (run, val); qse_awk_rtx_refupval (rtx, val);
return val; return val;
} }

View File

@ -635,14 +635,6 @@ qse_awk_val_t* qse_awk_rtx_setmapvalfld (
{ {
QSE_ASSERT (map->type == QSE_AWK_VAL_MAP); QSE_ASSERT (map->type == QSE_AWK_VAL_MAP);
#if 0
if (map->type != QSE_AWK_VAL_MAP)
{
qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOTIDX, QSE_NULL);
return QSE_NULL;
}
#endif
if (qse_htb_upsert ( if (qse_htb_upsert (
((qse_awk_val_map_t*)map)->map, ((qse_awk_val_map_t*)map)->map,
(qse_char_t*)kptr, klen, v, 0) == QSE_NULL) (qse_char_t*)kptr, klen, v, 0) == QSE_NULL)
@ -668,14 +660,6 @@ qse_awk_val_t* qse_awk_rtx_getmapvalfld (
QSE_ASSERT (map->type == QSE_AWK_VAL_MAP); QSE_ASSERT (map->type == QSE_AWK_VAL_MAP);
#if 0
if (map->type != QSE_AWK_VAL_MAP)
{
qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOTIDX, QSE_NULL);
return QSE_NULL;
}
#endif
pair = qse_htb_search (((qse_awk_val_map_t*)map)->map, kptr, klen); pair = qse_htb_search (((qse_awk_val_map_t*)map)->map, kptr, klen);
if (pair == QSE_NULL) if (pair == QSE_NULL)
{ {
@ -1712,7 +1696,7 @@ int qse_awk_rtx_setrefval (qse_awk_rtx_t* rtx, qse_awk_val_ref_t* ref, qse_awk_v
{ {
case QSE_AWK_VAL_MAP: case QSE_AWK_VAL_MAP:
/* a map is assigned to a positional. this is disallowed. */ /* a map is assigned to a positional. this is disallowed. */
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EPOSVALMAP, QSE_NULL); qse_awk_rtx_seterrnum (rtx, QSE_AWK_EMAPTOPOS, QSE_NULL);
return -1; return -1;
case QSE_AWK_VAL_STR: case QSE_AWK_VAL_STR:
@ -1757,7 +1741,7 @@ int qse_awk_rtx_setrefval (qse_awk_rtx_t* rtx, qse_awk_val_ref_t* ref, qse_awk_v
{ {
/* an indexed variable cannot be assigned a map. /* an indexed variable cannot be assigned a map.
* in other cases, it falls down to the default case. */ * in other cases, it falls down to the default case. */
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EIDXVALMAP, QSE_NULL); qse_awk_rtx_seterrnum (rtx, QSE_AWK_EMAPTOIDX, QSE_NULL);
return -1; return -1;
} }
/* fall through */ /* fall through */

View File

@ -111,6 +111,10 @@ EXTRA_DIST = \
lang-047.awk \ lang-047.awk \
lang-048.awk \ lang-048.awk \
lang-049.awk \ lang-049.awk \
lang-050.awk \
lang-051.awk \
lang-052.awk \
lang-053.awk \
columnate.awk \ columnate.awk \
levenshtein.awk \ levenshtein.awk \
levenshtein-utests.awk \ levenshtein-utests.awk \

View File

@ -346,6 +346,10 @@ EXTRA_DIST = \
lang-047.awk \ lang-047.awk \
lang-048.awk \ lang-048.awk \
lang-049.awk \ lang-049.awk \
lang-050.awk \
lang-051.awk \
lang-052.awk \
lang-053.awk \
columnate.awk \ columnate.awk \
levenshtein.awk \ levenshtein.awk \
levenshtein-utests.awk \ levenshtein-utests.awk \

View File

@ -0,0 +1,8 @@
# When a is assigned 20, a points to a scalar value.
# The second line turns it to a map if FLEXMAP is on.
# It is prohibited and results in an error if FLEXMAP is off.
BEGIN {
a=20;
a[10]=30;
for (i in a) print i, a[i];
}

View File

@ -0,0 +1,9 @@
#
# ARGC points to a scalar value.
# split() can turn it into a map if FLEXMAP is on.
# it is an error if FLEXMAP is off.
#
BEGIN {
split ("a b c d e", ARGC);
for (i in ARGC) print i, ARGC[i];
}

View File

@ -0,0 +1,4 @@
BEGIN {
split ("a b c d e", ARGV);
for (i in ARGV) print i, ARGV[i];
}

View File

@ -0,0 +1,12 @@
BEGIN {
a[1]=1;
a[2]=2;
b[4]=4;
b[5]=5;
#for (i in a) delete a[i];
#for (i in b) a[i]=b[i];
# if FLEXMAP is on, a = b acts like the 2 lines commented out above.
a = b;
for (i in a) print i, a[i];
}

View File

@ -144,19 +144,19 @@ USA 3615 237 North America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -f cou-019.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -f cou-019.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USSR 8649 275 Asia cou.dat: USSR 8649 275 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Canada 3852 25 North America cou.dat: Canada 3852 25 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: China 3705 1032 Asia cou.dat: China 3705 1032 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USA 3615 237 North America cou.dat: USA 3615 237 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Brazil 3286 134 South America cou.dat: Brazil 3286 134 South America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -f cou-020.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -f cou-020.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USSR 8649 275 Asia cou.dat: USSR 8649 275 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Canada 3852 25 North America cou.dat: Canada 3852 25 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: China 3705 1032 Asia cou.dat: China 3705 1032 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USA 3615 237 North America cou.dat: USA 3615 237 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Brazil 3286 134 South America cou.dat: Brazil 3286 134 South America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -f cou-021.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -f cou-021.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -937,7 +937,7 @@ my hello
my hello my hello
my hello my hello
my hello my hello
ERROR: CODE 16 LINE 6 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-002.awk - block nested too deeply ERROR: CODE 17 LINE 6 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-002.awk - block nested too deeply
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-003.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-003.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -956,7 +956,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-004.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-004.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 43 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-004.awk - function 'a' redefined ERROR: CODE 44 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-004.awk - function 'a' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1 [CMD] qseawk --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -984,7 +984,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1 [CMD] qseawk --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 44 LINE 5 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-006.awk - global variable 'a' redefined ERROR: CODE 45 LINE 5 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-006.awk - global variable 'a' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1 [CMD] qseawk --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1352,7 +1352,7 @@ BEGIN {
printf ("%s\n",10.34); printf ("%s\n",10.34);
} }
ERROR: CODE 104 LINE 3 COLUMN 2 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-013.awk - recursion detected in format conversion ERROR: CODE 109 LINE 3 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-013.awk - recursion detected in format conversion
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-014.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-014.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1367,7 +1367,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-015.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-015.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 16 LINE 3 COLUMN 50 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-015.awk - block nested too deeply ERROR: CODE 17 LINE 3 COLUMN 50 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-015.awk - block nested too deeply
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-016.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-016.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1481,27 +1481,27 @@ END {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-018.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-018.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 48 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-018.awk - duplicate global variable 'ARGV' ERROR: CODE 49 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-018.awk - duplicate global variable 'ARGV'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-019.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-019.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 50 LINE 1 COLUMN 15 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-019.awk - '+' not a valid parameter name ERROR: CODE 51 LINE 1 COLUMN 15 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-019.awk - '+' not a valid parameter name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-020.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-020.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 51 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-020.awk - '+' not a valid variable name ERROR: CODE 52 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-020.awk - '+' not a valid variable name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-021.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-021.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 51 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-021.awk - '+' not a valid variable name ERROR: CODE 52 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-021.awk - '+' not a valid variable name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-022.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-022.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 24 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-022.awk - left parenthesis expected in place of '=' ERROR: CODE 25 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-022.awk - left parenthesis expected in place of '='
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-023.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-023.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 29 LINE 5 COLUMN 20 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-023.awk - colon expected in place of ';' ERROR: CODE 30 LINE 5 COLUMN 20 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-023.awk - colon expected in place of ';'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-024.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-024.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1533,7 +1533,7 @@ BEGIN {
delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix; delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix;
} }
ERROR: CODE 80 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable ERROR: CODE 82 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-026.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-026.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1549,15 +1549,15 @@ abc
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-027.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-027.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 18 LINE 2 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-027.awk - invalid character '<NUL>' ERROR: CODE 19 LINE 2 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-027.awk - invalid character '<NUL>'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-028.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-028.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 42 LINE 2 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-028.awk - intrinsic function 'substr' redefined ERROR: CODE 43 LINE 2 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-028.awk - intrinsic function 'substr' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-029.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-029.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 43 LINE 9 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-029.awk - function 'abc' redefined ERROR: CODE 44 LINE 9 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-029.awk - function 'abc' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-030.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-030.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1667,7 +1667,7 @@ BEGIN {
--------------------- ---------------------
9210 9210
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
BEGIN { BEGIN {
while (((((("cat " datadir) "/") datafile) | getline x) > 0)) while (((((("cat " datadir) "/") datafile) | getline x) > 0))
@ -1734,7 +1734,7 @@ xx: 13
xx: 14 xx: 14
xx: 15 xx: 15
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
BEGIN { BEGIN {
max_cid_vars = 100; max_cid_vars = 100;
@ -2344,7 +2344,7 @@ nan
8103.08 8103.08
3 3
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
1 1
@ -2456,7 +2456,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -d- -f lang-049.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -d- -f lang-049.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 60 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-049.awk - no argument provided ERROR: CODE 62 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-049.awk - no argument provided
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on -F: -f columnate.awk passwd.dat </dev/stdin 2>&1 [CMD] qseawk --newline=on -F: -f columnate.awk passwd.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -2499,7 +2499,7 @@ mysql x 117 124 MySQL Server,,, /var/lib
openldap x 118 125 OpenLDAP Server Account,,, /nonexistent /bin/false openldap x 118 125 OpenLDAP Server Account,,, /nonexistent /bin/false
postfix x 119 126 /var/spool/postfix /bin/false postfix x 119 126 /var/spool/postfix /bin/false
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk --newline=on --extrakws=on -f levenshtein-utests.awk </dev/stdin 2>&1 [CMD] qseawk --newline=on -f levenshtein-utests.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
3: Correct distance between 'kitten' and 'sitting' 3: Correct distance between 'kitten' and 'sitting'
3: Correct distance between 'Saturday' and 'Sunday' 3: Correct distance between 'Saturday' and 'Sunday'
@ -2544,7 +2544,7 @@ Result Ra Rb Connect Error
1.E12 1.E12
99X 99X
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -vQSEAWK="/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1 [CMD] qseawk -vQSEAWK="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
0.0000000000 0.0000000000
0.11111111111111111111111111111 0.11111111111111111111111111111

View File

@ -144,19 +144,19 @@ USA 3615 237 North America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 -f cou-019.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -m 500000 -f cou-019.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USSR 8649 275 Asia cou.dat: USSR 8649 275 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Canada 3852 25 North America cou.dat: Canada 3852 25 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: China 3705 1032 Asia cou.dat: China 3705 1032 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USA 3615 237 North America cou.dat: USA 3615 237 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Brazil 3286 134 South America cou.dat: Brazil 3286 134 South America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 -f cou-020.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -m 500000 -f cou-020.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USSR 8649 275 Asia cou.dat: USSR 8649 275 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Canada 3852 25 North America cou.dat: Canada 3852 25 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: China 3705 1032 Asia cou.dat: China 3705 1032 Asia
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: USA 3615 237 North America cou.dat: USA 3615 237 North America
/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/cou.dat: Brazil 3286 134 South America cou.dat: Brazil 3286 134 South America
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 -f cou-021.awk cou.dat </dev/stdin 2>&1 [CMD] qseawk -m 500000 -f cou-021.awk cou.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -937,7 +937,7 @@ my hello
my hello my hello
my hello my hello
my hello my hello
ERROR: CODE 16 LINE 6 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-002.awk - block nested too deeply ERROR: CODE 17 LINE 6 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-002.awk - block nested too deeply
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-003.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-003.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -956,7 +956,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-004.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-004.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 43 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-004.awk - function 'a' redefined ERROR: CODE 44 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-004.awk - function 'a' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -984,7 +984,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 44 LINE 5 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-006.awk - global variable 'a' redefined ERROR: CODE 45 LINE 5 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-006.awk - global variable 'a' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1352,7 +1352,7 @@ BEGIN {
printf ("%s\n",10.34); printf ("%s\n",10.34);
} }
ERROR: CODE 104 LINE 3 COLUMN 2 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-013.awk - recursion detected in format conversion ERROR: CODE 109 LINE 3 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-013.awk - recursion detected in format conversion
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-014.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-014.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1367,7 +1367,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-015.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-015.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 16 LINE 3 COLUMN 50 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-015.awk - block nested too deeply ERROR: CODE 17 LINE 3 COLUMN 50 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-015.awk - block nested too deeply
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-016.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-016.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1481,27 +1481,27 @@ END {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-018.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-018.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 48 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-018.awk - duplicate global variable 'ARGV' ERROR: CODE 49 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-018.awk - duplicate global variable 'ARGV'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-019.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-019.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 50 LINE 1 COLUMN 15 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-019.awk - '+' not a valid parameter name ERROR: CODE 51 LINE 1 COLUMN 15 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-019.awk - '+' not a valid parameter name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-020.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-020.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 51 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-020.awk - '+' not a valid variable name ERROR: CODE 52 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-020.awk - '+' not a valid variable name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-021.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-021.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 51 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-021.awk - '+' not a valid variable name ERROR: CODE 52 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-021.awk - '+' not a valid variable name
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-022.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-022.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 24 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-022.awk - left parenthesis expected in place of '=' ERROR: CODE 25 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-022.awk - left parenthesis expected in place of '='
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-023.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-023.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 29 LINE 5 COLUMN 20 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-023.awk - colon expected in place of ';' ERROR: CODE 30 LINE 5 COLUMN 20 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-023.awk - colon expected in place of ';'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-024.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-024.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1533,7 +1533,7 @@ BEGIN {
delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix; delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix;
} }
ERROR: CODE 80 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable ERROR: CODE 82 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-026.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-026.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1549,15 +1549,15 @@ abc
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-027.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-027.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 18 LINE 2 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-027.awk - invalid character '<NUL>' ERROR: CODE 19 LINE 2 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-027.awk - invalid character '<NUL>'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-028.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-028.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 42 LINE 2 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-028.awk - intrinsic function 'substr' redefined ERROR: CODE 43 LINE 2 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-028.awk - intrinsic function 'substr' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-029.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-029.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 43 LINE 9 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-029.awk - function 'abc' redefined ERROR: CODE 44 LINE 9 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-029.awk - function 'abc' redefined
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-030.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-030.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -1667,7 +1667,7 @@ BEGIN {
--------------------- ---------------------
9210 9210
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
BEGIN { BEGIN {
while (((((("cat " datadir) "/") datafile) | getline x) > 0)) while (((((("cat " datadir) "/") datafile) | getline x) > 0))
@ -1734,7 +1734,7 @@ xx: 13
xx: 14 xx: 14
xx: 15 xx: 15
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
BEGIN { BEGIN {
max_cid_vars = 100; max_cid_vars = 100;
@ -2344,7 +2344,7 @@ nan
8103.08 8103.08
3 3
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
1 1
@ -2456,7 +2456,7 @@ BEGIN {
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -d- -f lang-049.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -d- -f lang-049.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
ERROR: CODE 60 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-049.awk - no argument provided ERROR: CODE 62 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-049.awk - no argument provided
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on -F: -f columnate.awk passwd.dat </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -F: -f columnate.awk passwd.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -2499,7 +2499,7 @@ mysql x 117 124 MySQL Server,,, /var/lib
openldap x 118 125 OpenLDAP Server Account,,, /nonexistent /bin/false openldap x 118 125 OpenLDAP Server Account,,, /nonexistent /bin/false
postfix x 119 126 /var/spool/postfix /bin/false postfix x 119 126 /var/spool/postfix /bin/false
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 --newline=on --extrakws=on -f levenshtein-utests.awk </dev/stdin 2>&1 [CMD] qseawk -m 500000 --newline=on -f levenshtein-utests.awk </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
3: Correct distance between 'kitten' and 'sitting' 3: Correct distance between 'kitten' and 'sitting'
3: Correct distance between 'Saturday' and 'Sunday' 3: Correct distance between 'Saturday' and 'Sunday'
@ -2544,7 +2544,7 @@ Result Ra Rb Connect Error
1.E12 1.E12
99X 99X
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
[CMD] qseawk -m 500000 -vQSEAWK="/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="/home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1 [CMD] qseawk -m 500000 -vQSEAWK="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
0.0000000000 0.0000000000
0.11111111111111111111111111111 0.11111111111111111111111111111

View File

@ -176,6 +176,14 @@ PROGS="
lang-047.awk!!!--newline=on --tolerant=on -d- lang-047.awk!!!--newline=on --tolerant=on -d-
lang-048.awk!!!--newline=on -d- lang-048.awk!!!--newline=on -d-
lang-049.awk!!!--newline=on -d- lang-049.awk!!!--newline=on -d-
lang-050.awk!!!--newline=on --flexmap=off -d-
lang-050.awk!!!--newline=on --flexmap=on -d-
lang-051.awk!!!--newline=on --flexmap=off -d-
lang-051.awk!!!--newline=on --flexmap=on -d-
lang-052.awk!!!--newline=on --flexmap=off -d-
lang-052.awk!!!--newline=on --flexmap=on -d-
lang-053.awk!!!--newline=on --flexmap=off -d-
lang-053.awk!!!--newline=on --flexmap=on -d-
columnate.awk!passwd.dat!!--newline=on -F: columnate.awk!passwd.dat!!--newline=on -F:
levenshtein-utests.awk!!!--newline=on levenshtein-utests.awk!!!--newline=on