changeset 35:8ac9f39db10f

func: Add basic type without more code.
author Lewin Bormann <lbo@spheniscida.de>
date Wed, 21 Aug 2019 10:51:42 +0200
parents e2ef3dd81205
children 97ebaf1119ba
files src/CMakeLists.txt src/func.c src/func.h
diffstat 3 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Wed Aug 21 10:51:14 2019 +0200
+++ b/src/CMakeLists.txt	Wed Aug 21 10:51:42 2019 +0200
@@ -4,7 +4,9 @@
 
 ADD_LIBRARY(core STATIC
     atom.c
-    expr.c)
+    expr.c
+    func.c
+    value.c)
 
 TARGET_LINK_LIBRARIES(core base)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/func.c	Wed Aug 21 10:51:42 2019 +0200
@@ -0,0 +1,2 @@
+#include "func.h"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/func.h	Wed Aug 21 10:51:42 2019 +0200
@@ -0,0 +1,26 @@
+#ifndef func_h
+#define func_h
+
+#include <src/base/str.h>
+#include <src/base/vec.h>
+
+/**
+ * @file func.h
+ * @brief Executable functions.
+ * @addtogroup language
+ * @{
+ */
+
+/**
+ * @brief Compiled function code. Functions are usually inserted in the global
+ * value table and referenced there.
+ */
+typedef struct {
+    ystr_t name;
+    yvec_t instructions;
+} yfunc_t;
+
+/**
+ * @}
+ */
+#endif