*** empty log message ***
This commit is contained in:
parent
cf179c7151
commit
a34b8dd9e7
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: awk.h,v 1.196 2007-03-02 14:41:30 bacon Exp $
|
* $Id: awk.h,v 1.197 2007-03-03 13:22:00 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -218,7 +218,8 @@ enum
|
|||||||
ASE_AWK_EINTERN, /* internal error */
|
ASE_AWK_EINTERN, /* internal error */
|
||||||
ASE_AWK_ERUNTIME, /* run-time error */
|
ASE_AWK_ERUNTIME, /* run-time error */
|
||||||
ASE_AWK_ERUNNING, /* there are running instances */
|
ASE_AWK_ERUNNING, /* there are running instances */
|
||||||
ASE_AWK_ERECUR, /* recursion too deep */
|
ASE_AWK_EBLKNST, /* blocke nested too deeply */
|
||||||
|
ASE_AWK_EEXPRNST, /* expression nested too deeply */
|
||||||
ASE_AWK_ESYSFNS, /* system functions not proper */
|
ASE_AWK_ESYSFNS, /* system functions not proper */
|
||||||
|
|
||||||
ASE_AWK_ESINOP,
|
ASE_AWK_ESINOP,
|
||||||
@ -315,6 +316,7 @@ enum
|
|||||||
ASE_AWK_EOFMTCHAR, /* an invalid character found in OFMT */
|
ASE_AWK_EOFMTCHAR, /* an invalid character found in OFMT */
|
||||||
|
|
||||||
/* regular expression error */
|
/* regular expression error */
|
||||||
|
ASE_AWK_EREXRECUR, /* recursion too deep */
|
||||||
ASE_AWK_EREXRPAREN, /* a right parenthesis is expected */
|
ASE_AWK_EREXRPAREN, /* a right parenthesis is expected */
|
||||||
ASE_AWK_EREXRBRACKET, /* a right bracket is expected */
|
ASE_AWK_EREXRBRACKET, /* a right bracket is expected */
|
||||||
ASE_AWK_EREXRBRACE, /* a right brace is expected */
|
ASE_AWK_EREXRBRACE, /* a right brace is expected */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: err.c,v 1.77 2007-03-02 11:47:52 bacon Exp $
|
* $Id: err.c,v 1.78 2007-03-03 13:22:00 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,8 @@ static const ase_char_t* __geterrstr (int errnum)
|
|||||||
ASE_T("internal error that should never have happened"),
|
ASE_T("internal error that should never have happened"),
|
||||||
ASE_T("general run-time error"),
|
ASE_T("general run-time error"),
|
||||||
ASE_T("one or more running instances"),
|
ASE_T("one or more running instances"),
|
||||||
ASE_T("recursion too deep"),
|
ASE_T("block nested too deeply"),
|
||||||
|
ASE_T("expressio nested too deeply"),
|
||||||
ASE_T("system functions not provided or not proper"),
|
ASE_T("system functions not provided or not proper"),
|
||||||
|
|
||||||
ASE_T("cannot open source input"),
|
ASE_T("cannot open source input"),
|
||||||
@ -126,6 +127,7 @@ static const ase_char_t* __geterrstr (int errnum)
|
|||||||
ASE_T("invalid character in CONVFMT"),
|
ASE_T("invalid character in CONVFMT"),
|
||||||
ASE_T("invalid character in OFMT"),
|
ASE_T("invalid character in OFMT"),
|
||||||
|
|
||||||
|
ASE_T("recursion too deep in the regular expression"),
|
||||||
ASE_T("a right parenthesis expected in the regular expression"),
|
ASE_T("a right parenthesis expected in the regular expression"),
|
||||||
ASE_T("a right bracket expected in the regular expression"),
|
ASE_T("a right bracket expected in the regular expression"),
|
||||||
ASE_T("a right brace expected in the regular expression"),
|
ASE_T("a right brace expected in the regular expression"),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: parse.c,v 1.247 2007-03-02 11:14:34 bacon Exp $
|
* $Id: parse.c,v 1.248 2007-03-03 13:22:00 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -1297,9 +1297,9 @@ static ase_awk_nde_t* __parse_block_dc (
|
|||||||
|
|
||||||
if (awk->parse.depth.cur.block >= awk->parse.depth.max.block)
|
if (awk->parse.depth.cur.block >= awk->parse.depth.max.block)
|
||||||
{
|
{
|
||||||
ase_awk_seterror_old (
|
ase_awk_seterror (
|
||||||
awk, ASE_AWK_ERECUR, awk->token.prev.line,
|
awk, ASE_AWK_EBLKNST,
|
||||||
ASE_T("block nested too deeply"));
|
awk->token.prev.line, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1790,9 +1790,9 @@ static ase_awk_nde_t* __parse_expression (ase_awk_t* awk, ase_size_t line)
|
|||||||
if (awk->parse.depth.max.expr > 0 &&
|
if (awk->parse.depth.max.expr > 0 &&
|
||||||
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
||||||
{
|
{
|
||||||
ase_awk_seterror_old (
|
ase_awk_seterror (
|
||||||
awk, ASE_AWK_ERECUR, line,
|
awk, ASE_AWK_EEXPRNST, line,
|
||||||
ASE_T("expression nested too deeply"));
|
ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2410,9 +2410,9 @@ static ase_awk_nde_t* __parse_unary (ase_awk_t* awk, ase_size_t line)
|
|||||||
if (awk->parse.depth.max.expr > 0 &&
|
if (awk->parse.depth.max.expr > 0 &&
|
||||||
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
||||||
{
|
{
|
||||||
ase_awk_seterror_old (
|
ase_awk_seterror (
|
||||||
awk, ASE_AWK_ERECUR, awk->token.line,
|
awk, ASE_AWK_EEXPRNST, awk->token.line,
|
||||||
ASE_T("expression nested too deeply"));
|
ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
awk->parse.depth.cur.expr++;
|
awk->parse.depth.cur.expr++;
|
||||||
@ -2470,9 +2470,9 @@ static ase_awk_nde_t* __parse_unary_exp (ase_awk_t* awk, ase_size_t line)
|
|||||||
if (awk->parse.depth.max.expr > 0 &&
|
if (awk->parse.depth.max.expr > 0 &&
|
||||||
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
awk->parse.depth.cur.expr >= awk->parse.depth.max.expr)
|
||||||
{
|
{
|
||||||
ase_awk_seterror_old (
|
ase_awk_seterror (
|
||||||
awk, ASE_AWK_ERECUR, awk->token.line,
|
awk, ASE_AWK_EEXPRNST, awk->token.line,
|
||||||
ASE_T("expression nested too deeply"));
|
ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
awk->parse.depth.cur.expr++;
|
awk->parse.depth.cur.expr++;
|
||||||
|
100
ase/awk/rex.c
100
ase/awk/rex.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: rex.c,v 1.76 2007-03-01 07:48:51 bacon Exp $
|
* $Id: rex.c,v 1.77 2007-03-03 13:22:01 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -213,18 +213,18 @@ static const ase_byte_t* __match_occurrences (
|
|||||||
static ase_bool_t __test_charset (
|
static ase_bool_t __test_charset (
|
||||||
matcher_t* matcher, const ase_byte_t* p, ase_size_t csc, ase_char_t c);
|
matcher_t* matcher, const ase_byte_t* p, ase_size_t csc, ase_char_t c);
|
||||||
|
|
||||||
static ase_bool_t __cc_isalnum (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isalnum (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isalpha (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isalpha (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isblank (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isblank (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_iscntrl (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_iscntrl (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isdigit (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isdigit (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isgraph (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isgraph (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_islower (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_islower (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isprint (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isprint (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_ispunct (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_ispunct (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isspace (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isspace (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isupper (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isupper (ase_awk_t* awk, ase_char_t c);
|
||||||
static ase_bool_t __cc_isxdigit (ase_awk_t* awk, ase_char_t c);
|
static ase_bool_t cc_isxdigit (ase_awk_t* awk, ase_char_t c);
|
||||||
|
|
||||||
static const ase_byte_t* __print_pattern (ase_awk_t* awk, const ase_byte_t* p);
|
static const ase_byte_t* __print_pattern (ase_awk_t* awk, const ase_byte_t* p);
|
||||||
static const ase_byte_t* __print_branch (ase_awk_t* awk, const ase_byte_t* p);
|
static const ase_byte_t* __print_branch (ase_awk_t* awk, const ase_byte_t* p);
|
||||||
@ -239,26 +239,26 @@ struct __char_class_t
|
|||||||
|
|
||||||
static struct __char_class_t __char_class[] =
|
static struct __char_class_t __char_class[] =
|
||||||
{
|
{
|
||||||
{ ASE_T("alnum"), 5, __cc_isalnum },
|
{ ASE_T("alnum"), 5, cc_isalnum },
|
||||||
{ ASE_T("alpha"), 5, __cc_isalpha },
|
{ ASE_T("alpha"), 5, cc_isalpha },
|
||||||
{ ASE_T("blank"), 5, __cc_isblank },
|
{ ASE_T("blank"), 5, cc_isblank },
|
||||||
{ ASE_T("cntrl"), 5, __cc_iscntrl },
|
{ ASE_T("cntrl"), 5, cc_iscntrl },
|
||||||
{ ASE_T("digit"), 5, __cc_isdigit },
|
{ ASE_T("digit"), 5, cc_isdigit },
|
||||||
{ ASE_T("graph"), 5, __cc_isgraph },
|
{ ASE_T("graph"), 5, cc_isgraph },
|
||||||
{ ASE_T("lower"), 5, __cc_islower },
|
{ ASE_T("lower"), 5, cc_islower },
|
||||||
{ ASE_T("print"), 5, __cc_isprint },
|
{ ASE_T("print"), 5, cc_isprint },
|
||||||
{ ASE_T("punct"), 5, __cc_ispunct },
|
{ ASE_T("punct"), 5, cc_ispunct },
|
||||||
{ ASE_T("space"), 5, __cc_isspace },
|
{ ASE_T("space"), 5, cc_isspace },
|
||||||
{ ASE_T("upper"), 5, __cc_isupper },
|
{ ASE_T("upper"), 5, cc_isupper },
|
||||||
{ ASE_T("xdigit"), 6, __cc_isxdigit },
|
{ ASE_T("xdigit"), 6, cc_isxdigit },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
{ ASE_T("arabic"), 6, __cc_isarabic },
|
{ ASE_T("arabic"), 6, cc_isarabic },
|
||||||
{ ASE_T("chinese"), 7, __cc_ischinese },
|
{ ASE_T("chinese"), 7, cc_ischinese },
|
||||||
{ ASE_T("english"), 7, __cc_isenglish },
|
{ ASE_T("english"), 7, cc_isenglish },
|
||||||
{ ASE_T("japanese"), 8, __cc_isjapanese },
|
{ ASE_T("japanese"), 8, cc_isjapanese },
|
||||||
{ ASE_T("korean"), 6, __cc_iskorean },
|
{ ASE_T("korean"), 6, cc_iskorean },
|
||||||
{ ASE_T("thai"), 4, __cc_isthai },
|
{ ASE_T("thai"), 4, cc_isthai },
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ ASE_NULL, 0, ASE_NULL }
|
{ ASE_NULL, 0, ASE_NULL }
|
||||||
@ -419,7 +419,7 @@ static int __build_pattern (builder_t* builder)
|
|||||||
|
|
||||||
if (builder->depth.max > 0 && builder->depth.cur >= builder->depth.max)
|
if (builder->depth.max > 0 && builder->depth.cur >= builder->depth.max)
|
||||||
{
|
{
|
||||||
builder->errnum = ASE_AWK_ERECUR;
|
builder->errnum = ASE_AWK_EREXRECUR;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1077,7 +1077,7 @@ static const ase_byte_t* __match_branch_body (
|
|||||||
|
|
||||||
if (matcher->depth.max > 0 && matcher->depth.cur >= matcher->depth.max)
|
if (matcher->depth.max > 0 && matcher->depth.cur >= matcher->depth.max)
|
||||||
{
|
{
|
||||||
matcher->errnum = ASE_AWK_ERECUR;
|
matcher->errnum = ASE_AWK_EREXRECUR;
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1683,62 +1683,62 @@ static ase_bool_t __test_charset (
|
|||||||
return ase_false;
|
return ase_false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isalnum (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isalnum (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISALNUM (awk, c);
|
return ASE_AWK_ISALNUM (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isalpha (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isalpha (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISALPHA (awk, c);
|
return ASE_AWK_ISALPHA (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isblank (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isblank (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return c == ASE_T(' ') || c == ASE_T('\t');
|
return c == ASE_T(' ') || c == ASE_T('\t');
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_iscntrl (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_iscntrl (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISCNTRL (awk, c);
|
return ASE_AWK_ISCNTRL (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isdigit (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isdigit (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISDIGIT (awk, c);
|
return ASE_AWK_ISDIGIT (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isgraph (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isgraph (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISGRAPH (awk, c);
|
return ASE_AWK_ISGRAPH (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_islower (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_islower (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISLOWER (awk, c);
|
return ASE_AWK_ISLOWER (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isprint (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isprint (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISPRINT (awk, c);
|
return ASE_AWK_ISPRINT (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_ispunct (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_ispunct (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISPUNCT (awk, c);
|
return ASE_AWK_ISPUNCT (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isspace (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isspace (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISSPACE (awk, c);
|
return ASE_AWK_ISSPACE (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isupper (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isupper (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISUPPER (awk, c);
|
return ASE_AWK_ISUPPER (awk, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ase_bool_t __cc_isxdigit (ase_awk_t* awk, ase_char_t c)
|
static ase_bool_t cc_isxdigit (ase_awk_t* awk, ase_char_t c)
|
||||||
{
|
{
|
||||||
return ASE_AWK_ISXDIGIT (awk, c);
|
return ASE_AWK_ISXDIGIT (awk, c);
|
||||||
}
|
}
|
||||||
@ -1770,12 +1770,12 @@ static const ase_byte_t* __print_pattern (ase_awk_t* awk, const ase_byte_t* p)
|
|||||||
|
|
||||||
static const ase_byte_t* __print_branch (ase_awk_t* awk, const ase_byte_t* p)
|
static const ase_byte_t* __print_branch (ase_awk_t* awk, const ase_byte_t* p)
|
||||||
{
|
{
|
||||||
ase_size_t na, bl, i;
|
ase_size_t i;
|
||||||
|
bhdr_t* bhdr;
|
||||||
|
|
||||||
|
bhdr = (bhdr_t*)p; p += ASE_SIZEOF(*bhdr);
|
||||||
|
|
||||||
na = *(ase_size_t*)p; p += ASE_SIZEOF(na);
|
for (i = 0; i < bhdr->na; i++)
|
||||||
bl = *(ase_size_t*)p; p += ASE_SIZEOF(bl);
|
|
||||||
|
|
||||||
for (i = 0; i < na; i++)
|
|
||||||
{
|
{
|
||||||
p = __print_atom (awk, p);
|
p = __print_atom (awk, p);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: run.c,v 1.336 2007-03-02 14:41:30 bacon Exp $
|
* $Id: run.c,v 1.337 2007-03-03 13:22:01 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -518,7 +518,8 @@ int ase_awk_setfilename (
|
|||||||
tmp = ase_awk_makestrval (run, name, len);
|
tmp = ase_awk_makestrval (run, name, len);
|
||||||
if (tmp == ASE_NULL)
|
if (tmp == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -544,7 +545,8 @@ int ase_awk_setofilename (
|
|||||||
tmp = ase_awk_makestrval (run, name, len);
|
tmp = ase_awk_makestrval (run, name, len);
|
||||||
if (tmp == ASE_NULL)
|
if (tmp == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -604,7 +606,7 @@ int ase_awk_run (ase_awk_t* awk,
|
|||||||
{
|
{
|
||||||
/* if it fails, the failure is reported thru
|
/* if it fails, the failure is reported thru
|
||||||
* the awk object */
|
* the awk object */
|
||||||
ase_awk_seterror_old (awk, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_seterror (awk, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,20 +718,23 @@ static int __init_run (
|
|||||||
run->inrec.maxflds = 0;
|
run->inrec.maxflds = 0;
|
||||||
run->inrec.d0 = ase_awk_val_nil;
|
run->inrec.d0 = ase_awk_val_nil;
|
||||||
if (ase_str_open (
|
if (ase_str_open (
|
||||||
&run->inrec.line, DEF_BUF_CAPA, &run->awk->prmfns.mmgr) == ASE_NULL)
|
&run->inrec.line,
|
||||||
|
DEF_BUF_CAPA, &run->awk->prmfns.mmgr) == ASE_NULL)
|
||||||
{
|
{
|
||||||
*errnum = ASE_AWK_ENOMEM;
|
*errnum = ASE_AWK_ENOMEM;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ase_str_open (&run->format.out, 256, &run->awk->prmfns.mmgr) == ASE_NULL)
|
if (ase_str_open (
|
||||||
|
&run->format.out, 256, &run->awk->prmfns.mmgr) == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_str_close (&run->inrec.line);
|
ase_str_close (&run->inrec.line);
|
||||||
*errnum = ASE_AWK_ENOMEM;
|
*errnum = ASE_AWK_ENOMEM;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ase_str_open (&run->format.fmt, 256, &run->awk->prmfns.mmgr) == ASE_NULL)
|
if (ase_str_open (
|
||||||
|
&run->format.fmt, 256, &run->awk->prmfns.mmgr) == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_str_close (&run->format.out);
|
ase_str_close (&run->format.out);
|
||||||
ase_str_close (&run->inrec.line);
|
ase_str_close (&run->inrec.line);
|
||||||
@ -933,7 +938,7 @@ static int __build_runarg (
|
|||||||
v_argv = ase_awk_makemapval (run);
|
v_argv = ase_awk_makemapval (run);
|
||||||
if (v_argv == ASE_NULL)
|
if (v_argv == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ase_awk_refupval (run, v_argv);
|
ase_awk_refupval (run, v_argv);
|
||||||
@ -947,7 +952,8 @@ static int __build_runarg (
|
|||||||
if (v_tmp == ASE_NULL)
|
if (v_tmp == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v_argv);
|
ase_awk_refdownval (run, v_argv);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,7 +977,8 @@ static int __build_runarg (
|
|||||||
* map will be freeed when v_argv is freed */
|
* map will be freeed when v_argv is freed */
|
||||||
ase_awk_refdownval (run, v_argv);
|
ase_awk_refdownval (run, v_argv);
|
||||||
|
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -981,7 +988,7 @@ static int __build_runarg (
|
|||||||
if (v_argc == ASE_NULL)
|
if (v_argc == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v_argv);
|
ase_awk_refdownval (run, v_argv);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1036,7 +1043,7 @@ static int __update_fnr (ase_awk_run_t* run, ase_size_t fnr)
|
|||||||
tmp = ase_awk_makeintval (run, fnr);
|
tmp = ase_awk_makeintval (run, fnr);
|
||||||
if (tmp == ASE_NULL)
|
if (tmp == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1091,7 +1098,8 @@ static int __set_globals_to_default (ase_awk_run_t* run)
|
|||||||
tmp = ase_awk_makestrval0 (run, gtab[i].str);
|
tmp = ase_awk_makestrval0 (run, gtab[i].str);
|
||||||
if (tmp == ASE_NULL)
|
if (tmp == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1145,7 +1153,8 @@ static int run_main (
|
|||||||
* the successful __raw_push. it is ok because
|
* the successful __raw_push. it is ok because
|
||||||
* the values pushed so far are all ase_awk_val_nil */
|
* the values pushed so far are all ase_awk_val_nil */
|
||||||
run->stack_top = saved_stack_top;
|
run->stack_top = saved_stack_top;
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1221,8 +1230,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
run->stack_top = saved_stack_top;
|
run->stack_top = saved_stack_top;
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1244,8 +1253,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
run->stack_top = saved_stack_top;
|
run->stack_top = saved_stack_top;
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1288,8 +1297,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
__raw_pop_times (run, run->awk->tree.nglobals);
|
__raw_pop_times (run, run->awk->tree.nglobals);
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1299,8 +1308,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
__raw_pop_times (run, run->awk->tree.nglobals);
|
__raw_pop_times (run, run->awk->tree.nglobals);
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,8 +1320,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
__raw_pop_times (run, run->awk->tree.nglobals);
|
__raw_pop_times (run, run->awk->tree.nglobals);
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1323,8 +1332,8 @@ static int run_main (
|
|||||||
__cleanup_globals (run);
|
__cleanup_globals (run);
|
||||||
__raw_pop_times (run, run->awk->tree.nglobals);
|
__raw_pop_times (run, run->awk->tree.nglobals);
|
||||||
|
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1563,7 +1572,8 @@ static int __run_block (ase_awk_run_t* run, ase_awk_nde_blk_t* nde)
|
|||||||
if (run->depth.max.block > 0 &&
|
if (run->depth.max.block > 0 &&
|
||||||
run->depth.cur.block >= run->depth.max.block)
|
run->depth.cur.block >= run->depth.max.block)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ERECUR, nde->line, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_EBLKNST, nde->line, ASE_NULL, 0);
|
||||||
return -1;;
|
return -1;;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1596,8 +1606,9 @@ static int __run_block0 (ase_awk_run_t* run, ase_awk_nde_blk_t* nde)
|
|||||||
|
|
||||||
if (run->errnum == ASE_AWK_EIOIMPL)
|
if (run->errnum == ASE_AWK_EIOIMPL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ECOUTDT, nde->line, ASE_NULL);
|
run, ASE_AWK_ECOUTDT, nde->line,
|
||||||
|
ASE_NULL, 0);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1611,8 +1622,9 @@ static int __run_block0 (ase_awk_run_t* run, ase_awk_nde_blk_t* nde)
|
|||||||
|
|
||||||
if (run->errnum == ASE_AWK_EIOIMPL)
|
if (run->errnum == ASE_AWK_EIOIMPL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (
|
ase_awk_setrunerror (
|
||||||
run, ASE_AWK_ECOUTDT, nde->line, ASE_NULL);
|
run, ASE_AWK_ECOUTDT, nde->line,
|
||||||
|
ASE_NULL, 0);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -6696,7 +6708,8 @@ ase_char_t* ase_awk_format (
|
|||||||
GROW (&run->format.tmp);
|
GROW (&run->format.tmp);
|
||||||
if (run->format.tmp.ptr == ASE_NULL)
|
if (run->format.tmp.ptr == ASE_NULL)
|
||||||
{
|
{
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6790,7 +6803,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
width--;
|
width--;
|
||||||
@ -6802,7 +6816,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (ase_str_ccat (out, ch) == -1)
|
if (ase_str_ccat (out, ch) == -1)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6814,7 +6829,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
width--;
|
width--;
|
||||||
@ -6899,7 +6915,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (str_free != ASE_NULL)
|
if (str_free != ASE_NULL)
|
||||||
ASE_AWK_FREE (run->awk, str_free);
|
ASE_AWK_FREE (run->awk, str_free);
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
width--;
|
width--;
|
||||||
@ -6913,7 +6930,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (str_free != ASE_NULL)
|
if (str_free != ASE_NULL)
|
||||||
ASE_AWK_FREE (run->awk, str_free);
|
ASE_AWK_FREE (run->awk, str_free);
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6927,7 +6945,8 @@ ase_char_t* ase_awk_format (
|
|||||||
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
if (ase_str_ccat (out, ASE_T(' ')) == -1)
|
||||||
{
|
{
|
||||||
ase_awk_refdownval (run, v);
|
ase_awk_refdownval (run, v);
|
||||||
ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, ASE_NULL);
|
ase_awk_setrunerror (
|
||||||
|
run, ASE_AWK_ENOMEM, 0, ASE_NULL, 0);
|
||||||
return ASE_NULL;
|
return ASE_NULL;
|
||||||
}
|
}
|
||||||
width--;
|
width--;
|
||||||
|
Loading…
Reference in New Issue
Block a user