From 20f26853298e6debc73fe891bbbc8532417bc20a Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 25 Sep 2016 11:33:06 +0200 Subject: Constant code names --- examples/time.fusp | 3 +++ interpreter/eval.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 examples/time.fusp 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: -- cgit v1.2.3