changeset 62:b4000861eea5

func: Mini update of func.h
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 24 Aug 2019 21:45:27 +0200
parents 81b4668981e6
children fed8eb63d9ab
files src/func.h
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/func.h	Sat Aug 24 21:26:44 2019 +0200
+++ b/src/func.h	Sat Aug 24 21:45:27 2019 +0200
@@ -1,5 +1,7 @@
-#ifndef func_h
-#define func_h
+#ifndef src_func_h
+#define src_func_h
+
+#include <src/types.h>
 
 #include <src/base/str.h>
 #include <src/base/vec.h>
@@ -11,10 +13,6 @@
  * @{
  */
 
-typedef struct {
-    ystr_t name;
-} yfunc_desc_t;
-
 /**
  * @brief Compiled function code. Functions are usually inserted in the global
  * value table and referenced there.
@@ -22,8 +20,9 @@
  * TODO: Extend to allow reference capture for closures.
  */
 typedef struct {
-    yfunc_desc_t desc;
-    yvec_t instructions;
+    ystr_t name;
+    size_t nargs;
+    yexpr_t body;
 } yfunc_t;
 
 /**