diff options
author | Quinn Stephens <quinn@osmora.org> | 2024-11-07 16:59:19 -0500 |
---|---|---|
committer | Quinn Stephens <quinn@osmora.org> | 2024-11-07 16:59:19 -0500 |
commit | 6ab9c3732793b6fd40e6388cf1b08756194c0ea6 (patch) | |
tree | e7ae86e1bad944192f0b6fd130cb7d84afa4f180 /include/list.h | |
parent | 063c40584ae78a396b558a5e2a08e3d871450c0b (diff) |
[compiler] Parse return statementsmain
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 <quinn@osmora.org>
Diffstat (limited to 'include/list.h')
-rw-r--r-- | include/list.h | 7 |
1 files changed, 7 insertions, 0 deletions
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 <stdbool.h> #include <stddef.h> 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) { |