List type and generic base type, char wrapper type

This commit is contained in:
vegowotenks 2024-10-10 18:53:40 +02:00
parent 647f739d08
commit 471cf679cd
6 changed files with 124 additions and 5 deletions

View file

@ -27,6 +27,11 @@
#include "../submodules/utilitiec/src/StringView/StringView.h"
#include "../submodules/utilitiec/src/Scratchpad/Scratchpad.h"
typedef struct FlupType_s {
ObjectType* type;
struct FlupType_s* next;
} FlupType;
typedef struct CallFrame_s {
size_t instruction_pointer;
/* ip = condition start : start
@ -34,9 +39,11 @@ typedef struct CallFrame_s {
*
*/
FlupFunction* self_function;
FlupFunctionAlternative* alternative;
FlupFunction* functions; // functions defined in this callframe
FlupVariable* variables; // variables defined in this callframe
FlupType* types; // types defined in this callframe
DynamicArray stack; // Value
Scratchpad memory_pad;
} CallFrame;
@ -45,6 +52,7 @@ int CallFrame_Create(CallFrame* self, FlupFunction* self_function);
void CallFrame_Destroy(CallFrame* self);
int CallFrame_DefineVariable(CallFrame* self, StringView name, Value value);
int CallFrame_DefineObjectType(CallFrame* self, ObjectType* type);
int CallFrame_StackPop(CallFrame* self, Value* dest);
int CallFrame_StackPush(CallFrame* self, Value* value);
FlupVariable* CallFrame_FindVariable(CallFrame* self, StringView name);