added a bit of code into sed

This commit is contained in:
hyung-hwan 2009-02-10 08:14:00 +00:00
parent b1211d6e58
commit 79c1d6b861
4 changed files with 17 additions and 5 deletions

View File

@ -171,7 +171,7 @@ int tgp_main (int argc, qse_char_t* argv[])
if (handle_args (argc, argv) == -1) return -1;
tgp = qse_tgp_open (QSE_MMGR_GETDFL());
tgp = qse_tgp_open (QSE_NULL, 0);
if (tgp == QSE_NULL)
{
qse_fprintf (QSE_STDERR,

View File

@ -22,6 +22,7 @@
#include <qse/types.h>
#include <qse/macros.h>
#include <qse/cmn/str.h>
#include <qse/cmn/lda.h>
enum qse_sed_errnum_t
{
@ -45,6 +46,9 @@ struct qse_sed_t
void* lastrex;
qse_str_t rexbuf; /* temporary regular expression buffer */
/* command array */
qse_lda_t cmds;
};

View File

@ -198,7 +198,12 @@ static const qse_char_t* command (
#if 0
case QSE_T('{'):
cmd = QSE_SED_C_B;
/* insert a negaited branch command at the beginning
* of a group. this way, all the commands in a group
* can be skipped. the branch target is set once a
* corresponding } is met. */
cmd.type = QSE_SED_C_BRANCH;
cmd.negfl = !cmd.negfl;
break;
case QSE_T('}'):

View File

@ -88,7 +88,10 @@ struct qse_sed_c_t
QSE_SED_C_CW,
QSE_SED_C_Y,
QSE_SED_C_X
} cmd;
} type;
/* TODO: change the data type to a shorter one to save space */
int negfl;
};
struct qse_sed_l_t