From 23e5342cb0680c66410bdc0062b89ad9b826462a Mon Sep 17 00:00:00 2001 From: tocariimaa Date: Wed, 5 Feb 2025 18:06:03 -0300 Subject: [PATCH] move typedefs to top --- pila.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pila.c b/pila.c index 4f76ed6..fdf39f5 100644 --- a/pila.c +++ b/pila.c @@ -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;