aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-01 12:43:00 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-01 12:43:00 -0400
commit6583fe9b389a6b4698f9364945885e6783506886 (patch)
tree0464456d177eab051b03f29a74218a45b301f174 /src/parse
parent0cfae753aa131f949253f3fba1e3a36c2bde6ac0 (diff)
Convert to using more zero values for `none`
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/files.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse/files.c b/src/parse/files.c
index caecbbe8..5e0dc29c 100644
--- a/src/parse/files.c
+++ b/src/parse/files.c
@@ -17,7 +17,6 @@
#include "statements.h"
#include "text.h"
#include "typedefs.h"
-#include "types.h"
#include "utils.h"
// The cache of {filename -> parsed AST} will hold at most this many entries:
@@ -67,7 +66,7 @@ ast_t *parse_file(const char *path, jmp_buf *on_err) {
// hold more than PARSE_CACHE_SIZE entries (see below), but each entry's
// AST holds onto a reference to the file it came from, so they could
// potentially be somewhat large.
- static Table_t cached = {};
+ static Table_t cached = EMPTY_TABLE;
ast_t *ast = Table$str_get(cached, path);
if (ast) return ast;
@@ -106,6 +105,7 @@ ast_t *parse_file(const char *path, jmp_buf *on_err) {
const char *path;
ast_t *ast;
} *to_remove = Table$entry(cached, 1);
+ assert(to_remove);
Table$str_remove(&cached, to_remove->path);
}