From: Brendan Hansen Date: Wed, 2 Nov 2022 03:10:55 +0000 (-0500) Subject: random cleanup X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=7e31396fb2773375e64e2106e4e4a1097ba964e5;p=onyxlang.io.git random cleanup --- diff --git a/src/app.onyx b/src/app.onyx index d923656..9baa098 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -22,7 +22,7 @@ reg: otmp.TemplateRegistry; .[ 9, 10, 11, 12 ] ], - test = ^reg, + test = req, }); res->status(200); } @@ -38,9 +38,9 @@ main :: () { #if #defined(runtime.vars.Debug) { app->pipe((req, res) => { - printf("Before: {}\n", alloc.heap.get_watermark()); + // printf("Before: {}\n", alloc.heap.get_watermark()); reg->refresh_templates(); - printf("After: {}\n", alloc.heap.get_watermark()); + // printf("After: {}\n", alloc.heap.get_watermark()); }); } diff --git a/src/html-templates/module.onyx b/src/html-templates/module.onyx index e3b0da5..2230b9b 100644 --- a/src/html-templates/module.onyx +++ b/src/html-templates/module.onyx @@ -1,7 +1,5 @@ package otmp - -#load "core/std" #load_all "./src" diff --git a/src/html-templates/src/otmp.onyx b/src/html-templates/src/otmp.onyx index 9b7f757..e1f57da 100644 --- a/src/html-templates/src/otmp.onyx +++ b/src/html-templates/src/otmp.onyx @@ -93,7 +93,7 @@ delete :: (t: ^TemplateRegistry) { return .Template_Not_Found; } - tscope, err := core.misc.any_to_map(scope); + tscope, _ := core.misc.any_to_map(scope); defer delete(^tscope); return temp->render(self, ^tscope, output); diff --git a/src/html-templates/src/render.onyx b/src/html-templates/src/render.onyx index 7610f03..4fd012a 100644 --- a/src/html-templates/src/render.onyx +++ b/src/html-templates/src/render.onyx @@ -22,8 +22,6 @@ TemplateRenderer :: struct { #package render_template :: (use r: ^TemplateRenderer) -> Error { - core.printf("{*}\n", scope); - return render_instructions(r, t.instructions); } @@ -131,8 +129,6 @@ resolve_expr_to_any :: (use r: ^TemplateRenderer, expr: ^TExpr) -> any { sub_any := resolve_expr_to_any(r, subscript.var); sub := any_to_int(resolve_expr_to_any(r, subscript.sub)); - core.printf("{} {}\n", sub_any, sub); - return any_subscript(sub_any, ~~ sub); } } diff --git a/www/templates/index.html b/www/templates/index.html index 3ed620f..e18027d 100644 --- a/www/templates/index.html +++ b/www/templates/index.html @@ -31,8 +31,8 @@ -

Name: {% $test.templates.entries[0] %}

-

Age: {% $test.arena %}

+

Name: {% $test.headers %}

+

Age: {% $test.cookies %}

{{endblock}}