added the pragmas field to qse_awk_sio_arg_t

This commit is contained in:
hyung-hwan 2019-05-09 16:35:53 +00:00
parent a6267135ba
commit 72c27c7e48
2 changed files with 11 additions and 11 deletions

View File

@ -595,6 +595,7 @@ struct qse_awk_sio_arg_t
qse_size_t colm;
qse_awk_sio_lxc_t last;
int pragmas;
};
/**

View File

@ -689,6 +689,7 @@ int qse_awk_parse (qse_awk_t* awk, qse_awk_sio_t* sio)
awk->sio.last.c = QSE_CHAR_EOF;
awk->sio.arg.line = 1;
awk->sio.arg.colm = 1;
awk->sio.arg.pragmas = 0;
awk->sio.inp = &awk->sio.arg;
n = parse (awk);
@ -711,9 +712,7 @@ static int end_include (qse_awk_t* awk)
* retry to read a character from an outer file */
CLRERR (awk);
x = awk->sio.inf (
awk, QSE_AWK_SIO_CLOSE,
awk->sio.inp, QSE_NULL, 0);
x = awk->sio.inf(awk, QSE_AWK_SIO_CLOSE, awk->sio.inp, QSE_NULL, 0);
/* if closing has failed, still destroy the
* sio structure first as normal and return
@ -731,8 +730,7 @@ static int end_include (qse_awk_t* awk)
if (x != 0)
{
/* the failure mentioned above is returned here */
if (ISNOERR(awk))
SETERR_ARG (awk, QSE_AWK_ECLOSE, QSE_T("<SIN>"), 5);
if (ISNOERR(awk)) SETERR_ARG (awk, QSE_AWK_ECLOSE, QSE_T("<SIN>"), 5);
return -1;
}
@ -762,7 +760,7 @@ static int begin_include (qse_awk_t* awk)
if (awk->opt.incldirs.ptr)
{
/* include directory is set... */
/* TODO: */
/* TODO: search target files in these directories */
}
/* store the include-file name into a list
@ -789,6 +787,7 @@ static int begin_include (qse_awk_t* awk)
arg->name = (const qse_char_t*)(link + 1);
arg->line = 1;
arg->colm = 1;
arg->pragmas = 0;
/* let the argument's prev field point to the current */
arg->prev = awk->sio.inp;
@ -821,7 +820,7 @@ static int begin_include (qse_awk_t* awk)
oops:
/* i don't need to free 'link' here since it's linked to awk->sio_names
* that's freed at the beginning of qse_awk_parse() or by qse_awk_close(). */
if (arg) QSE_AWK_FREE (awk, arg);
if (arg) qse_awk_freemem (awk, arg);
return -1;
}