aded STIX_SYNERR_INCLUDE

This commit is contained in:
hyunghwan.chung 2015-07-03 14:38:37 +00:00
parent 5ba0c67dd1
commit 132e4b48bb
5 changed files with 13 additions and 5 deletions

View File

@ -1383,7 +1383,11 @@ static int begin_include (stix_t* stix)
arg->colm = 1; arg->colm = 1;
arg->includer = stix->c->curinp; arg->includer = stix->c->curinp;
if (stix->c->impl (stix, STIX_IO_OPEN, arg) <= -1) goto oops; if (stix->c->impl (stix, STIX_IO_OPEN, arg) <= -1)
{
set_syntax_error (stix, STIX_SYNERR_INCLUDE, &stix->c->tok.loc, &stix->c->tok.name);
goto oops;
}
stix->c->curinp = arg; stix->c->curinp = arg;
/* stix->c->depth.incl++; */ /* stix->c->depth.incl++; */

View File

@ -80,6 +80,8 @@ static STIX_INLINE stix_ssize_t open_input (stix_t* stix, stix_ioarg_t* arg)
return -1; return -1;
} }
/* TODO: make bcs relative to the includer */
#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__)
arg->handle = fopen (bcs, "rb"); arg->handle = fopen (bcs, "rb");
#else #else
@ -211,7 +213,8 @@ static char* syntax_error_msg[] =
"too many block temporaries", "too many block temporaries",
"too many block arguments", "too many block arguments",
"too large block", "too large block",
"wrong primitive number" "wrong primitive number",
"#include error"
}; };
stix_uch_t str_stix[] = { 'S', 't', 'i', 'x' }; stix_uch_t str_stix[] = { 'S', 't', 'i', 'x' };

View File

@ -326,7 +326,8 @@ enum stix_synerrnum_t
STIX_SYNERR_BLKTMPRFLOOD, /* too many block temporaries */ STIX_SYNERR_BLKTMPRFLOOD, /* too many block temporaries */
STIX_SYNERR_BLKARGFLOOD, /* too many block arguments */ STIX_SYNERR_BLKARGFLOOD, /* too many block arguments */
STIX_SYNERR_BLKFLOOD, /* too large block */ STIX_SYNERR_BLKFLOOD, /* too large block */
STIX_SYNERR_PRIMNO /* wrong primitive number */ STIX_SYNERR_PRIMNO, /* wrong primitive number */
STIX_SYNERR_INCLUDE /* #include error */
}; };
typedef enum stix_synerrnum_t stix_synerrnum_t; typedef enum stix_synerrnum_t stix_synerrnum_t;

View File

@ -376,7 +376,7 @@ enum stix_obj_type_t
STIX_OBJ_TYPE_OOP, STIX_OBJ_TYPE_OOP,
STIX_OBJ_TYPE_CHAR, STIX_OBJ_TYPE_CHAR,
STIX_OBJ_TYPE_BYTE, STIX_OBJ_TYPE_BYTE,
STIX_OBJ_TYPE_WORD, STIX_OBJ_TYPE_WORD
/* /*
STIX_OBJ_TYPE_UINT8, STIX_OBJ_TYPE_UINT8,

View File

@ -310,7 +310,7 @@ static STIX_INLINE int bcs_to_ucs_with_cmgr (
stix_size_t mlen, wlen; stix_size_t mlen, wlen;
int n; int n;
for (bp = bcs; *bp != '\0'; bp++); for (bp = bcs; *bp != '\0'; bp++) /* nothing */ ;
mlen = bp - bcs; wlen = *ucslen; mlen = bp - bcs; wlen = *ucslen;
n = bcsn_to_ucsn_with_cmgr (bcs, &mlen, ucs, &wlen, cmgr, all); n = bcsn_to_ucsn_with_cmgr (bcs, &mlen, ucs, &wlen, cmgr, all);