Fix TODOs
This commit is contained in:
@@ -778,7 +778,8 @@ static Node *parse_html(Parser *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s->cur == s->len) {
|
if (s->cur == s->len) {
|
||||||
ASSERT(0); // TODO
|
parser_report(p, "Invaid end of source inside HTML tag");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
s->cur++;
|
s->cur++;
|
||||||
|
|
||||||
@@ -789,7 +790,8 @@ static Node *parse_html(Parser *p)
|
|||||||
while (s->cur < s->len && is_space(s->src[s->cur]))
|
while (s->cur < s->len && is_space(s->src[s->cur]))
|
||||||
s->cur++;
|
s->cur++;
|
||||||
if (s->cur == s->len || s->src[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++;
|
s->cur++;
|
||||||
no_body = true;
|
no_body = true;
|
||||||
@@ -833,7 +835,8 @@ static Node *parse_html(Parser *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s->cur == s->len) {
|
if (s->cur == s->len) {
|
||||||
ASSERT(0); // TODO
|
parser_report(p, "Missing closing HTML tag </%.*s>", tagname.len, tagname.ptr);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
s->cur++;
|
s->cur++;
|
||||||
|
|
||||||
@@ -845,17 +848,20 @@ static Node *parse_html(Parser *p)
|
|||||||
|
|
||||||
t = next_token(p);
|
t = next_token(p);
|
||||||
if (t.type != TOKEN_IDENT) {
|
if (t.type != TOKEN_IDENT) {
|
||||||
ASSERT(0); // TODO
|
parser_report(p, "Missing tag name after '</'");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
String closing_tagname = t.sval;
|
String closing_tagname = t.sval;
|
||||||
|
|
||||||
if (!streq(closing_tagname, tagname)) {
|
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);
|
t = next_token(p);
|
||||||
if (t.type != TOKEN_OPER_GRT) {
|
if (t.type != TOKEN_OPER_GRT) {
|
||||||
ASSERT(0);
|
parser_report(p, "Missing '>' in closing HTML tag");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -2546,9 +2552,6 @@ static void cg_pop_scope(Codegen *cg)
|
|||||||
|
|
||||||
call->next = cg->free_list_calls;
|
call->next = cg->free_list_calls;
|
||||||
cg->free_list_calls = call;
|
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;
|
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)
|
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) {
|
switch (node->type) {
|
||||||
|
|
||||||
case NODE_NESTED:
|
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)
|
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) {
|
switch (node->type) {
|
||||||
|
|
||||||
case NODE_GLOBAL:
|
case NODE_GLOBAL:
|
||||||
@@ -3586,7 +3583,9 @@ WL_AddResult wl_compiler_add(WL_Compiler *compiler, WL_String content)
|
|||||||
if (include->include_root == NULL) {
|
if (include->include_root == NULL) {
|
||||||
|
|
||||||
if (compiler->num_files == FILE_LIMIT) {
|
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
|
// TODO: Make the path relative to the compiled file
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ else
|
|||||||
LFLAGS =
|
LFLAGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -Wall -Wextra -O0 -g3 -I3p -fsanitize=address,undefined
|
CFLAGS = -Wall -Wextra -O0 -g3 -I3p
|
||||||
|
|
||||||
HFILES = $(shell find src 3p -name "*.h")
|
HFILES = $(shell find src 3p -name "*.h")
|
||||||
CFILES = $(filter-out 3p/sqlite3.c, $(shell find src 3p -name "*.c"))
|
CFILES = $(filter-out 3p/sqlite3.c, $(shell find src 3p -name "*.c"))
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ void session_storage_free(SessionStorage *storage)
|
|||||||
free(storage);
|
free(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <stdio.h> // TODO
|
|
||||||
|
|
||||||
static Session *lookup_session_slot(SessionStorage *storage, HTTP_String sess, bool find_unused)
|
static Session *lookup_session_slot(SessionStorage *storage, HTTP_String sess, bool find_unused)
|
||||||
{
|
{
|
||||||
if (find_unused && 2 * storage->count + 2 > storage->capacity)
|
if (find_unused && 2 * storage->count + 2 > storage->capacity)
|
||||||
|
|||||||
@@ -91,8 +91,6 @@ int sqlite3utils_prepare(SQLiteCache *cache, sqlite3_stmt **pstmt, char *fmt, in
|
|||||||
int i = lookup(cache, fmt, fmtlen);
|
int i = lookup(cache, fmt, fmtlen);
|
||||||
if (cache->items[i].stmt == NULL) {
|
if (cache->items[i].stmt == NULL) {
|
||||||
|
|
||||||
printf("Preparing statement [%.*s]\n", fmtlen, fmt); // TODO
|
|
||||||
|
|
||||||
sqlite3_stmt *stmt;
|
sqlite3_stmt *stmt;
|
||||||
int ret = sqlite3_prepare_v2(cache->db, fmt, -1, &stmt, NULL);
|
int ret = sqlite3_prepare_v2(cache->db, fmt, -1, &stmt, NULL);
|
||||||
if (ret != SQLITE_OK) {
|
if (ret != SQLITE_OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user