From 6ab9c3732793b6fd40e6388cf1b08756194c0ea6 Mon Sep 17 00:00:00 2001 From: Quinn Stephens Date: Thu, 7 Nov 2024 16:59:19 -0500 Subject: [compiler] Parse return statements Laid groundwork for statements and AST trees. Currently return values are not supported, expression parsing must be implemented first. Also stopped dumping parsed type definitions. Signed-off-by: Quinn Stephens --- include/list.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/list.h') diff --git a/include/list.h b/include/list.h index 0364f7c..69d0c33 100644 --- a/include/list.h +++ b/include/list.h @@ -7,6 +7,7 @@ #ifndef _LIST_H #define _LIST_H +#include #include struct list_entry { @@ -20,6 +21,12 @@ struct list { size_t length; }; +static inline bool +list_is_empty(struct list *list) +{ + return list->head == (struct list_entry*)list; +} + static inline void list_remove(struct list_entry *entry) { -- cgit v1.2.3