aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-09-25 11:33:06 +0200
committerCamil Staps2016-09-25 11:33:06 +0200
commit20f26853298e6debc73fe891bbbc8532417bc20a (patch)
tree13e2ea3a7aa20a8dff584197de2f60900b622b67
parentUpdate documentation: graph rewriting, code names list (diff)
Constant code names
-rw-r--r--examples/time.fusp3
-rw-r--r--interpreter/eval.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/time.fusp b/examples/time.fusp
new file mode 100644
index 0000000..26a4f84
--- /dev/null
+++ b/examples/time.fusp
@@ -0,0 +1,3 @@
+time = code time;
+
+main = time;
diff --git a/interpreter/eval.c b/interpreter/eval.c
index f37039b..6933c0d 100644
--- a/interpreter/eval.c
+++ b/interpreter/eval.c
@@ -341,7 +341,12 @@ void eval(fuspel* rules, struct node** node, bool to_rnf) {
break;
case NODE_CODE:
- //TODO
+ if (*((unsigned char*) (*node)->var2) == 0) {
+ Code_0* code_fun = (Code_0*) (*node)->var1;
+ code_fun(node);
+ use_node(*node, 1);
+ rerun = 1;
+ }
break;
case NODE_REDIRECT: