random cleanup
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 2 Nov 2022 03:10:55 +0000 (22:10 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 2 Nov 2022 03:10:55 +0000 (22:10 -0500)
src/app.onyx
src/html-templates/module.onyx
src/html-templates/src/otmp.onyx
src/html-templates/src/render.onyx
www/templates/index.html

index d923656299f9ff1efd237e4ad80056963ed2d7ef..9baa098ed96a33d0abe9c55d5a376c783f96f6fe 100644 (file)
@@ -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());
         });
     }
 
index e3b0da50c0e2ecc5801eafc6d1d88b4186545160..2230b9b448d63d039753ef95dd09cb0203c7adbd 100644 (file)
@@ -1,7 +1,5 @@
 package otmp
 
-
-#load "core/std"
 #load_all "./src"
 
 
index 9b7f7579cc104adb249484cb0d296f6cc4f0ba83..e1f57dabbe9b58b51d5b646f5989b4795d10fa41 100644 (file)
@@ -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);
index 7610f03109ebe8c6ef2a05778b13d4db60561cf8..4fd012ab18413a1050e1f8d178e17495370ef512 100644 (file)
@@ -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);
         }
     }
index 3ed620f22c4f24f24d2309b96f68a8b97c64dc6c..e18027d0a87e7cf22e9c4771b05983c9ce37737a 100644 (file)
@@ -31,8 +31,8 @@
         </tbody>
     </table>
 
-    <p>Name: {% $test.templates.entries[0] %} </p>
-    <p>Age:  {% $test.arena %} </p>
+    <p>Name: {% $test.headers %} </p>
+    <p>Age:  {% $test.cookies %} </p>
 
 {{endblock}}