Files @ 36cc1fe490f7
Branch filter:

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

MH
Merge branch 'feat-api-cmds-and-branching'

Implements the programmer-facing API to allow programmatic
specification of a synchronous round. The way in which these put/get
interactions are performed is in an initial shape. Perhaps this will
change in the future.

The second main set of changes is the addion of a 'fork' statement,
which allows explicit forking, and allowing multiple puts/gets over the
same transport link within a single sync round.
#version 100

composite main() {
	channel xo -> xi;
	new a(xi);
	new c(xo);
}

primitive a(in x) {
	sync {
		msg m = get(x);
		assert m.length == 5;
		assert m[0] == 'h';
		assert m[1] == 'e';
		assert m[2] == 'l';
		assert m[3] == 'l';
		assert m[4] == 'o';
	}
}

primitive b(out x) {
	synchronous (msg m) {
		put(x, m);
	}
}
// or
primitive c(out x) {
	sync {
		msg m = create(5);
		m[0] = 'h';
		m[1] = 'e';
		m[2] = 'l';
		m[3] = 'l';
		m[4] = 'o';
		put(x, m);
	}
}