Fix TODOs

This commit is contained in:
2025-08-24 14:30:04 +02:00
parent f8cf026b00
commit 6dc9a10628
4 changed files with 16 additions and 21 deletions
+15 -16
View File
@@ -778,7 +778,8 @@ static Node *parse_html(Parser *p)
}
if (s->cur == s->len) {
ASSERT(0); // TODO
parser_report(p, "Invaid end of source inside HTML tag");
return NULL;
}
s->cur++;
@@ -789,7 +790,8 @@ static Node *parse_html(Parser *p)
while (s->cur < s->len && is_space(s->src[s->cur]))
s->cur++;
if (s->cur == s->len || s->src[s->cur] != '>') {
ASSERT(0); // TODO
parser_report(p, "Invalid character inside HTML closing tag");
return NULL;
}
s->cur++;
no_body = true;
@@ -833,7 +835,8 @@ static Node *parse_html(Parser *p)
}
if (s->cur == s->len) {
ASSERT(0); // TODO
parser_report(p, "Missing closing HTML tag </%.*s>", tagname.len, tagname.ptr);
return NULL;
}
s->cur++;
@@ -845,17 +848,20 @@ static Node *parse_html(Parser *p)
t = next_token(p);
if (t.type != TOKEN_IDENT) {
ASSERT(0); // TODO
parser_report(p, "Missing tag name after '</'");
return NULL;
}
String closing_tagname = t.sval;
if (!streq(closing_tagname, tagname)) {
ASSERT(0); // TODO
parser_report(p, "HTML tag mismatch (%.*s != %.*s)", tagname.len, tagname.ptr, closing_tagname.len, closing_tagname.ptr);
return NULL;
}
t = next_token(p);
if (t.type != TOKEN_OPER_GRT) {
ASSERT(0);
parser_report(p, "Missing '>' in closing HTML tag");
return NULL;
}
break;
@@ -2546,9 +2552,6 @@ static void cg_pop_scope(Codegen *cg)
call->next = cg->free_list_calls;
cg->free_list_calls = call;
// TODO: remove
ASSERT(cg->scopes[cg->num_scopes-1].calls == NULL || (cg->scopes[cg->num_scopes-1].calls - cg->calls >= 0 && cg->scopes[cg->num_scopes-1].calls - cg->calls < MAX_UNPATCHED_CALLS));
}
cg->num_syms = scope->idx_syms;
@@ -2621,9 +2624,6 @@ static void walk_node(Codegen *cg, Node *node);
static void walk_expr_node(Codegen *cg, Node *node, bool one)
{
// TODO: remove
ASSERT(cg->scopes[cg->num_scopes-1].calls == NULL || (cg->scopes[cg->num_scopes-1].calls - cg->calls >= 0 && cg->scopes[cg->num_scopes-1].calls - cg->calls < MAX_UNPATCHED_CALLS));
switch (node->type) {
case NODE_NESTED:
@@ -2927,9 +2927,6 @@ static void walk_expr_node(Codegen *cg, Node *node, bool one)
static void walk_node(Codegen *cg, Node *node)
{
// TODO: remove
ASSERT(cg->scopes[cg->num_scopes-1].calls == NULL || (cg->scopes[cg->num_scopes-1].calls - cg->calls >= 0 && cg->scopes[cg->num_scopes-1].calls - cg->calls < MAX_UNPATCHED_CALLS));
switch (node->type) {
case NODE_GLOBAL:
@@ -3586,7 +3583,9 @@ WL_AddResult wl_compiler_add(WL_Compiler *compiler, WL_String content)
if (include->include_root == NULL) {
if (compiler->num_files == FILE_LIMIT) {
ASSERT(0); // TODO
snprintf(compiler->err, sizeof(compiler->err), "File limit reached");
compiler->err = true;
return (WL_AddResult) { .type=WL_ADD_ERROR };
}
// TODO: Make the path relative to the compiled file
+1 -1
View File
@@ -6,7 +6,7 @@ else
LFLAGS =
endif
CFLAGS = -Wall -Wextra -O0 -g3 -I3p -fsanitize=address,undefined
CFLAGS = -Wall -Wextra -O0 -g3 -I3p
HFILES = $(shell find src 3p -name "*.h")
CFILES = $(filter-out 3p/sqlite3.c, $(shell find src 3p -name "*.c"))
-2
View File
@@ -86,8 +86,6 @@ void session_storage_free(SessionStorage *storage)
free(storage);
}
#include <stdio.h> // TODO
static Session *lookup_session_slot(SessionStorage *storage, HTTP_String sess, bool find_unused)
{
if (find_unused && 2 * storage->count + 2 > storage->capacity)
-2
View File
@@ -91,8 +91,6 @@ int sqlite3utils_prepare(SQLiteCache *cache, sqlite3_stmt **pstmt, char *fmt, in
int i = lookup(cache, fmt, fmtlen);
if (cache->items[i].stmt == NULL) {
printf("Preparing statement [%.*s]\n", fmtlen, fmt); // TODO
sqlite3_stmt *stmt;
int ret = sqlite3_prepare_v2(cache->db, fmt, -1, &stmt, NULL);
if (ret != SQLITE_OK) {