From aec19e55ca32f68536a550f100d3f058b8a93c02 Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Sat, 4 Jan 2025 01:25:31 +0200
Subject: initial move checking

+ Missing implementations for most things, but it already highlights
  an oversight in my initial plan, namely that currently, a function
  might call multiple of its closures, meaning that a closure wouldn't
  be allowed to move a value. I'm debating whether to check that only
  one closure from a parameter list is called at a time or if I should
  do what Hylo does and add in some kind of 'subscript' that's like a
  function but has slightly different rules?
---
 src/compiler.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/compiler.c')

diff --git a/src/compiler.c b/src/compiler.c
index d18e767..9f564d8 100644
--- a/src/compiler.c
+++ b/src/compiler.c
@@ -21,6 +21,7 @@
 #include <fwd/debug.h>
 #include <fwd/scope.h>
 #include <fwd/lower.h>
+#include <fwd/move.h>
 
 /**
  * Read whole file into a buffer and return pointer to buffer.
@@ -112,6 +113,9 @@ static int process(struct scope **parent, const char *file)
 	if (analyze_root(scope, tree))
 		return -1;
 
+	if (mvcheck_root(tree))
+		return -1;
+
 	return 0;
 }
 
-- 
cgit v1.2.3