diff --git a/testdata/parser/positive/18.pdl b/testdata/parser/positive/18.pdl new file mode 100644 index 0000000000000000000000000000000000000000..5482cb85c351f86974ce4d87eb7b4936c98719d0 --- /dev/null +++ b/testdata/parser/positive/18.pdl @@ -0,0 +1,42 @@ +#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); +}