Files @ 031c9d14adaa
Branch filter:

Location: CSY/reowolf/testdata/parser/positive/18.pdl

MH
Merge branch 'feat-bytecode'

Adds size/alignment/offset computations to the type system and detects
potentially infinite types. If the type is potentially infinite but
contains a union that can break that type loop, then all other variants
of that union are supposed to be allocated on the heap. If the type
is potentially infinite but cannot be broken up, then we throw the
appropriate error.

The size/alignment/offset computations are not yet employed in the
runtime. But prepares Reowolf for a proper bytecode/IR implementation.
#version 100

import std.reo;

composite main() {}

primitive main1(in a, out c) {
	int x = 0;
	int y = 0;
	msg z = null;
	msg w = null;
	x = 1;
	y = 1;
	while (true) {
		synchronous {
			if (x > 0 && fires(a)) {
				z = get(a);
				x--;
			}
			if (w != null && fires(c)) {
				put(c, w);
				w = null;
				y++;
			}
		}
		synchronous {
			assert !fires(a) && !fires(c);
			if (z != null && y > 0) {
				w = z;
				z = null;
				y--;
				x++;
			}
		}
	}
}

composite main2(in a, out c) {
	channel xo -> xi;
	new fifo(a, xo, null);
	new fifo(xi, c, null);
}