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 Word Word;
typedef struct DictionaryEntry DictionaryEntry; typedef struct DictionaryEntry DictionaryEntry;
typedef struct RpnState RpnState; 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 void (*NativeWord)(RpnState *);
typedef struct { struct Str {
char *s; char *s;
isize len; isize len;
} Str; };
typedef enum { enum ValueKind {
VAL_NIL, VAL_NIL,
VAL_INT, VAL_INT,
VAL_STR, VAL_STR,
} ValueKind; };
typedef struct { struct Value {
ValueKind kind; ValueKind kind;
union { union {
u64 intn; u64 intn;
Str str; Str str;
}; };
} Value; };
typedef enum { enum WordKind {
WORD_NATIVE, WORD_NATIVE,
WORD_USER, WORD_USER,
} WordKind; };
struct UserWord { struct UserWord {
Word **words; Word **words;