refactored internal strings

This commit is contained in:
2020-11-12 16:52:56 -06:00
parent 0e92ddea2b
commit 01b796460a
5 changed files with 28 additions and 12 deletions

View File

@@ -12,6 +12,12 @@ typedef struct CCallFrame {
CValue* base;
} CCallFrame;
typedef enum {
INTERNALSTRING_INIT, // __init
INTERNALSTRING_EQUAL, // __equal
INTERNALSTRING_MAX
} InternalStringEnum;
typedef struct CState {
bool panic;
int freezeGC; // when > 0, GC events will be ignored (for internal use)
@@ -31,7 +37,7 @@ typedef struct CState {
CCallFrame callFrame[FRAME_MAX]; // call frames
int frameCount;
CObjString *initString;
CObjString *internalStrings[INTERNALSTRING_MAX]; // strings used internally by the VM, eg. __init
} CState;
COSMO_API CState *cosmoV_newState();