git » unicorn-sparkle-basic.git » commit 06fc627

towards eval

author Alan Dipert
2024-04-14 04:28:37 UTC
committer Alan Dipert
2024-04-14 04:28:37 UTC
parent 2c4fb8fb669bf481c868d20b8dc70592a376f831

towards eval

main.c +17 -3

diff --git a/main.c b/main.c
index 6d8e995..d584258 100644
--- a/main.c
+++ b/main.c
@@ -7,13 +7,27 @@
 
 #include "lines.h"
 #include <stdio.h>
-#include <stdbool.h>
+
+/* TODO */
+/* env hashtable */
+/* eval_expr - returns a TYPE */
+/* eval_stmt - returns void but optionally sets jump dest */
+void eval_stmt(struct node_tag *node) {
+  /* switch (node->type) { */
+  /*   case  */
+  /* } */
+}
+
+void run(struct node_tag **lines) {
+  for (size_t i = 0; i < vector_size(lines); i++) {
+    eval_stmt(lines[i]);
+  }
+}
 
 void read_loop() {
-  true;
   struct node_tag *line;
   struct node_tag **lines = vector_create();
-  while (true) {
+  while (1) {
     if ((line = read_line_stdin("🦄 "))) {
       printf("It parsed 👍\n");
       printf("linum: %g\n", line->data.line.linum);