X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fmain.c;h=6645f6e4564f72f72f67d1bea7949761452be844;hb=58a5ffdfec139a0c9d399f603b77a764ae8607f7;hp=6c6124eb5bfacf2530675665342404db8f342819;hpb=6c1eef40f411ff4eec7a3f7599a81be7fae07e2a;p=muddle-interpreter.git diff --git a/src/main.c b/src/main.c index 6c6124e..6645f6e 100644 --- a/src/main.c +++ b/src/main.c @@ -28,8 +28,8 @@ License along with this file. If not, see // TODO: put these in interpreter-wide ctx object pool_object *pool; pool_ptr ptop; -char *vhp_base; -char *vhp; +object *vhp_base; +heap_ptr vhp; // TODO: store these in current PROCESS frame *cf; @@ -71,7 +71,7 @@ main () vhp_base = mmap (0, VECTOR_OBJCT * sizeof (object), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - vhp = vhp_base; + vhp = 1; // Reader stack (TODO: dynamically allocate as VECTOR). object rst_base[READER_OBJCT]; @@ -85,7 +85,7 @@ main () { // mock GC (no object persistence) ptop = 1; - vhp = vhp_base; + vhp = 1; // terminate input assert (buf[n - 1] == '\n'); buf[n - 1] = '\0'; @@ -105,9 +105,9 @@ main () // Eval the thing cf->prevcst = cst; push_frame (eval, new_tuple (st.pos, 1), 0); - while (cf->cont.fn) + while (cf->cont.val.fn) { - cf->cont.fn (); + cf->cont.val.fn (); } // Print the thing print_object (&ret);