Fixes and added include statement

This commit is contained in:
2025-08-08 11:41:25 +02:00
parent 3c7aafba10
commit acf2ea7b97
16 changed files with 738 additions and 235 deletions
+22 -5
View File
@@ -4,7 +4,7 @@
// This file was generated automatically. Do not modify directly!
////////////////////////////////////////////////////////////////////////////////////////
// src/public.h
// src/compile.h
////////////////////////////////////////////////////////////////////////////////////////
#ifndef WL_PUBLIC_INCLUDED
@@ -45,10 +45,27 @@ typedef struct {
int cur;
} WL_Arena;
int WL_compile (char *src, int len, WL_Arena arena, WL_Program *program, char *err, int errmax);
WL_State *WL_State_init (WL_Arena *a, WL_Program p, char *err, int errmax);
void WL_State_free (WL_State *state);
WL_Result WL_eval (WL_State *state);
typedef struct WL_Compiler WL_Compiler;
typedef enum {
WL_COMPILE_RESULT_DONE,
WL_COMPILE_RESULT_FILE,
WL_COMPILE_RESULT_ERROR,
} WL_CompileResultType;
typedef struct {
WL_CompileResultType type;
WL_Program program;
WL_String path;
} WL_CompileResult;
WL_Compiler* WL_Compiler_init (WL_Arena *arena);
void WL_Compiler_free (WL_Compiler *compiler);
WL_CompileResult WL_compile (WL_Compiler *compiler, WL_String file, WL_String content);
WL_State* WL_State_init (WL_Arena *a, WL_Program p, char *err, int errmax);
void WL_State_free (WL_State *state);
WL_Result WL_eval (WL_State *state);
int WL_streq (WL_String a, char *b, int blen);
int WL_peeknone (WL_State *state, int off);
int WL_peekint (WL_State *state, int off, long long *x);