move typedefs to top

This commit is contained in:
tocariimaa 2025-02-05 18:06:03 -03:00
parent 7028ee4369
commit 23e5342cb0

20
pila.c
View file

@ -18,31 +18,35 @@ typedef struct UserWord UserWord;
typedef struct Word Word;
typedef struct DictionaryEntry DictionaryEntry;
typedef struct RpnState RpnState;
typedef struct Str Str;
typedef struct Value Value;
typedef enum ValueKind ValueKind;
typedef enum WordKind WordKind;
typedef void (*NativeWord)(RpnState *);
typedef struct {
struct Str {
char *s;
isize len;
} Str;
};
typedef enum {
enum ValueKind {
VAL_NIL,
VAL_INT,
VAL_STR,
} ValueKind;
};
typedef struct {
struct Value {
ValueKind kind;
union {
u64 intn;
Str str;
};
} Value;
};
typedef enum {
enum WordKind {
WORD_NATIVE,
WORD_USER,
} WordKind;
};
struct UserWord {
Word **words;