trying to verify class attribute list implementation - still not complete
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
hyung-hwan 2024-10-07 01:42:40 +09:00
parent 20bdc0d52d
commit 86d9a137c8
3 changed files with 27 additions and 17 deletions

View File

@ -261,7 +261,7 @@
(((hcl_oow_t)spec) & HCL_LBMASK(hcl_oow_t, HCL_CLASS_SELFSPEC_FLAG_BITS)) (((hcl_oow_t)spec) & HCL_LBMASK(hcl_oow_t, HCL_CLASS_SELFSPEC_FLAG_BITS))
#define HCL_CLASS_SELFSPEC_FLAG_FINAL (1 << 0) #define HCL_CLASS_SELFSPEC_FLAG_FINAL (1 << 0)
#define HCL_CLASS_SELFSPEC_FLAG_LIMITED (1 << 1) #define HCL_CLASS_SELFSPEC_FLAG_LIMITED (1 << 1) /* not allowed to instantiate normally */
#define HCL_MAX_CLASSVARS HCL_BITS_MAX(hcl_oow_t, HCL_CLASS_SELFSPEC_CLASSVAR_BITS) #define HCL_MAX_CLASSVARS HCL_BITS_MAX(hcl_oow_t, HCL_CLASS_SELFSPEC_CLASSVAR_BITS)

View File

@ -2904,15 +2904,18 @@ static HCL_INLINE void stop_ticker (void)
os2_tick_done = 1; os2_tick_done = 1;
} }
#elif defined(__DOS__) && (defined(_INTELC32_) || defined(__WATCOMC__)) #elif defined(__DOS__) && (defined(_INTELC32_) || defined(__WATCOMC__) || defined(__BORLANDC__))
#if defined(_INTELC32_) #if defined(_INTELC32_)
static void (*dos_prev_timer_intr_handler) (void); static void (*dos_prev_timer_intr_handler) (void);
#pragma interrupt(dos_timer_intr_handler) #pragma interrupt(dos_timer_intr_handler)
static void dos_timer_intr_handler (void) static void dos_timer_intr_handler (void)
#else #elif defined(__WATCOMC__)
static void (__interrupt *dos_prev_timer_intr_handler) (void); static void (__interrupt *dos_prev_timer_intr_handler) (void);
static void __interrupt dos_timer_intr_handler (void) static void __interrupt dos_timer_intr_handler (void)
#else
static void (interrupt *dos_prev_timer_intr_handler) (void);
static void interrupt dos_timer_intr_handler (void)
#endif #endif
{ {
/* /*
@ -3113,11 +3116,18 @@ static HCL_INLINE void stop_ticker (void)
# define sys_dl_getsym(x,n) GetProcAddress(x,n) # define sys_dl_getsym(x,n) GetProcAddress(x,n)
#elif defined(USE_MACH_O_DYLD) #elif defined(USE_MACH_O_DYLD)
# define sys_dl_error() mach_dlerror() # define sys_dl_error(void) mach_dlerror()
# define sys_dl_open(x) mach_dlopen(x) # define sys_dl_open(x) mach_dlopen(x)
# define sys_dl_openext(x) mach_dlopen(x) # define sys_dl_openext(x) mach_dlopen(x)
# define sys_dl_close(x) mach_dlclose(x) # define sys_dl_close(x) mach_dlclose(x)
# define sys_dl_getsym(x,n) mach_dlsym(x,n) # define sys_dl_getsym(x,n) mach_dlsym(x,n)
#else
static const char* sys_dl_error(void) { return HCL_NULL; }
static void* sys_dl_open(const char* x) { return HCL_NULL; }
static void* sys_dl_openext(const char* x) { return HCL_NULL; }
static void sys_dl_close(void* x) { return HCL_NULL; }
static void* sys_dl_getsym(void* x, const char* n) { return HCL_NULL; }
#endif #endif
#if defined(USE_WIN_DLL) #if defined(USE_WIN_DLL)

View File

@ -1,9 +1,9 @@
class Apex { class Apex {
fun ::basicNew(size) { fun(#class) basicNew(size) {
return (core.basicNew self size) return (core.basicNew self size)
} }
fun ::respondsTo(mth) { fun(#class) respondsTo(mth) {
return (core.classRespondsTo self mth) return (core.classRespondsTo self mth)
} }
@ -32,10 +32,10 @@ class Apex {
} }
} }
class Object :: Apex { class Object: Apex {
} }
class Class :: Apex [ class(#uncopyable #varying #limited) Class: Apex [
_name _name
_mdic _mdic
_spec _spec
@ -62,13 +62,13 @@ class Class :: Apex [
} }
} }
class Collection :: Object { class Collection: Object {
fun length() { fun length() {
return (core.basicSize self) return (core.basicSize self)
} }
} }
class IndexedCollection :: Collection { class IndexedCollection: Collection {
fun slice(index count) { fun slice(index count) {
return (core.slice self index count) return (core.slice self index count)
} }
@ -82,8 +82,8 @@ class IndexedCollection :: Collection {
} }
} }
class FixedSizedCollection :: IndexedCollection { class FixedSizedCollection: IndexedCollection {
fun ::new(size) { fun(#class) new(size) {
| obj iv | | obj iv |
obj := (core.basicNew self size) obj := (core.basicNew self size)
if (self:respondsTo "initValue") { ## TODO: change "initValue" to a symbol once supported if (self:respondsTo "initValue") { ## TODO: change "initValue" to a symbol once supported
@ -102,11 +102,11 @@ class FixedSizedCollection :: IndexedCollection {
##} ##}
} }
class Array :: FixedSizedCollection { class Array: FixedSizedCollection {
} }
class String :: FixedSizedCollection { class String: FixedSizedCollection {
fun ::initValue() { fun(#class) initValue() {
##return '\0' ##return '\0'
return ' ' return ' '
} }
@ -166,8 +166,8 @@ printf "----------------------------------------\n"
k := #[1 2 3] k := #[1 2 3]
printf "%O\n" (k:basicAt 2) printf "%O\n" (k:basicAt 2)
class Z :: Object [ a b c ] { class Z: Object [ a b c ] {
fun :* new() { fun(#classinst) new() {
self.a := 10 self.a := 10
self.b := 20 self.b := 20
self.c := 30 self.c := 30