fixed the definition of STIX_SETBITS()
This commit is contained in:
parent
52d3e2528e
commit
646a5e45a7
@ -2693,8 +2693,8 @@ static int compile_method_primitive (stix_t* stix)
|
||||
{
|
||||
case STIX_IOTOK_NUMLIT: /* TODO: allow only an integer */
|
||||
/*TODO: more checks the validity of the primitive number. support number with radix and so on support more extensive syntax. support primitive name, not number*/
|
||||
ptr = stix->c->tok.name.ptr;
|
||||
end = ptr + stix->c->tok.name.len;
|
||||
ptr = TOKEN_NAME_PTR(stix);
|
||||
end = ptr + TOKEN_NAME_LEN(stix);
|
||||
prim_no = 0;
|
||||
while (ptr < end && is_digitchar(*ptr))
|
||||
{
|
||||
@ -3209,7 +3209,6 @@ static int compile_block_expression (stix_t* stix)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int add_to_byte_array_literal_buffer (stix_t* stix, stix_oob_t b)
|
||||
{
|
||||
if (stix->c->mth.balit_count >= stix->c->mth.balit_capa)
|
||||
@ -3324,8 +3323,8 @@ static int __read_array_literal (stix_t* stix, stix_oop_t* xlit)
|
||||
break;
|
||||
|
||||
case STIX_IOTOK_CHARLIT:
|
||||
STIX_ASSERT (stix->c->tok.name.len == 1);
|
||||
lit = STIX_CHAR_TO_OOP(stix->c->tok.name.ptr[0]);
|
||||
STIX_ASSERT (TOKEN_NAME_LEN(stix) == 1);
|
||||
lit = STIX_CHAR_TO_OOP(TOKEN_NAME_PTR(stix)[0]);
|
||||
break;
|
||||
|
||||
case STIX_IOTOK_STRLIT:
|
||||
@ -3585,8 +3584,8 @@ static int compile_expression_primary (stix_t* stix, const stix_oocs_t* ident, c
|
||||
break;
|
||||
|
||||
case STIX_IOTOK_CHARLIT:
|
||||
STIX_ASSERT (stix->c->tok.name.len == 1);
|
||||
if (emit_push_character_literal(stix, stix->c->tok.name.ptr[0]) <= -1) return -1;
|
||||
STIX_ASSERT (TOKEN_NAME_LEN(stix) == 1);
|
||||
if (emit_push_character_literal(stix, TOKEN_NAME_PTR(stix)[0]) <= -1) return -1;
|
||||
GET_TOKEN (stix);
|
||||
break;
|
||||
|
||||
@ -5023,8 +5022,8 @@ static int __compile_pooldic_definition (stix_t* stix)
|
||||
goto add_literal;
|
||||
|
||||
case STIX_IOTOK_CHARLIT:
|
||||
STIX_ASSERT (stix->c->tok.name.len == 1);
|
||||
lit = STIX_CHAR_TO_OOP(stix->c->tok.name.ptr[0]);
|
||||
STIX_ASSERT (TOKEN_NAME_LEN(stix) == 1);
|
||||
lit = STIX_CHAR_TO_OOP(TOKEN_NAME_PTR(stix)[0]);
|
||||
goto add_literal;
|
||||
|
||||
case STIX_IOTOK_STRLIT:
|
||||
|
@ -274,7 +274,39 @@ static void unload (stix_t* stix, stix_prim_mod_t* mod)
|
||||
int stix_prim_mod_con (stix_t* stix, stix_prim_mod_t* mod)
|
||||
{
|
||||
mod->query = query;
|
||||
mod->unload = unload;
|
||||
mod->unload = unload;
|
||||
mod->ctx = STIX_NULL;
|
||||
|
||||
#if 0
|
||||
|
||||
#include 'Stix.st'.
|
||||
#import 'Console'.
|
||||
|
||||
c = stix_findclass (stix, "Console");
|
||||
if (!c) c = stix_makeclass (stix, "Console", "x y"); <- provides an API to create a simple class
|
||||
|
||||
stix_addmethod (stix, c, "open", prim_open);
|
||||
stix_addmethod (stix, c, "close:", prim_close);
|
||||
stix_addmethod (stix, c, "setCursorTo:", prim_setcursor);
|
||||
stix_addmethod (stix, c, "clear", prim_clear );
|
||||
stix_addmethod (stix, c, "write", prim_write );
|
||||
|
||||
|
||||
|
||||
|
||||
/* GRAMMER ENHANCEMENT */
|
||||
fun abc (a, b, c) <----- this style, register C style method
|
||||
{
|
||||
}
|
||||
|
||||
fun abc: a with: b c: c <----- smalltalk style
|
||||
{
|
||||
}
|
||||
|
||||
abc->def (a, b, c) <------- use -> as an c style method indicator
|
||||
abc abc: a with: b c: c
|
||||
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -434,7 +434,13 @@ struct stix_ntime_t
|
||||
#define STIX_GETBITS(type,value,offset,length) \
|
||||
((((type)(value)) >> (offset)) & STIX_LBMASK(type,length))
|
||||
|
||||
#define STIX_CLEARBITS(type,value,offset,length) \
|
||||
(((type)(value)) & ~(STIX_LBMASK(type,length) << (offset)))
|
||||
|
||||
#define STIX_SETBITS(type,value,offset,length,bits) \
|
||||
(value = (STIX_CLEARBITS(type,value,offset,length) | (((bits) & STIX_LBMASK(type,length)) << (offset))))
|
||||
|
||||
#define STIX_ORBITS(type,value,offset,length,bits) \
|
||||
(value = (((type)(value)) | (((bits) & STIX_LBMASK(type,length)) << (offset))))
|
||||
|
||||
|
||||
@ -560,11 +566,12 @@ struct stix_cmgr_t
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__>=199901L)
|
||||
/* C99 has inline */
|
||||
# define STIX_INLINE inline
|
||||
# define STIX_HAVE_INLINE
|
||||
#elif defined(__GNUC__) && defined(__GNUC_GNU_INLINE__)
|
||||
/* gcc disables inline when -std=c89 or -ansi is used.
|
||||
* so use __inline__ supported by gcc regardless of the options */
|
||||
/* gcc disables inline when -std=c89 or -ansi is used.
|
||||
* so use __inline__ supported by gcc regardless of the options */
|
||||
# define STIX_INLINE /*extern*/ __inline__
|
||||
# define STIX_HAVE_INLINE
|
||||
#else
|
||||
@ -572,9 +579,6 @@ struct stix_cmgr_t
|
||||
# undef STIX_HAVE_INLINE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The STIX_TYPE_IS_SIGNED() macro determines if a type is signed.
|
||||
* \code
|
||||
|
@ -63,7 +63,6 @@
|
||||
*/
|
||||
#define STIX_LIMIT_OBJ_SIZE
|
||||
|
||||
|
||||
/* TODO: delete these header inclusion lines */
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
Loading…
Reference in New Issue
Block a user