Index: tests/concurrent/waitfor/parse.cfa
===================================================================
--- tests/concurrent/waitfor/parse.cfa	(revision cca568e32a0a35aff9eb80fa5e403e3d338d349e)
+++ tests/concurrent/waitfor/parse.cfa	(revision 674081149fa6bb3dd05efce0381f3b6bbf88a920)
@@ -1,10 +1,16 @@
-//----------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------
+// 
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
 //
-//		DEPRECATED TEST
-//		DIFFERS BETWEEN DEBUG AND RELEASE
-//
-//----------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// waitfor.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Aug 30 17:53:29 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Apr 10 22:52:18 2023
+// Update Count     : 64
+// 
 
 #include <monitor.hfa>
@@ -12,91 +18,244 @@
 monitor M {};
 
-M a;
-
-void f1( M & mutex a );
-void f2( M & mutex a );
-void f2( M & mutex a, M & mutex b );
-void f3( M & mutex a );
-void f3( M & mutex a, M & mutex b );
-void f3( M & mutex a, M & mutex b, M & mutex c );
-
-void foo() {
-
-	//---------------------------------------
-	waitfor( f1 : a ) {
-		1;
-	}
-
-	//---------------------------------------
-	waitfor( f1 : a ) {
-		2;
-	}
-	waitfor( f2 : a ) {
-		3;
-	}
-
-	//---------------------------------------
-	when( 1 < 3 ) waitfor( f2 : a, a ) {
-		4;
-	}
-	or timeout( 100 ) {
-		5;
-	}
-
-	//---------------------------------------
-	when( 2 < 3 ) waitfor( f3 : a ) {
-		5;
-	}
+void notcalled( M & mutex m1, M & mutex m2 ) {
+	abort();
+}
+void or( M & mutex m ) {
+	abort();
+}
+void timeout( M & mutex m ) {
+	abort();
+}
+
+void fred( M & mutex m, M & mutex or, M & mutex timeout ) {
+	// test waitfor and when
+
+	waitfor( notcalled : m, m );
+
+	waitfor( notcalled : m, m ) {
+	}
+
+	waitfor( notcalled : m, m ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+
+	when( true ) waitfor( notcalled : m, m ) {
+	}
+
+	waitfor( notcalled : m, m );
+	or waitfor( notcalled : m, m );
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) waitfor( notcalled : m, m );
+
+	waitfor( notcalled : m, m ) {
+	} or waitfor( notcalled : m, m ) {
+	}
+
+	waitfor( notcalled : m, m ) {
+	} or waitfor( notcalled : m, m ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) waitfor( notcalled : m, m ) {
+	}
+
+	waitfor( notcalled : m, m );
+	or waitfor( notcalled : m, m ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) waitfor( notcalled : m, m ) {
+	}
+
+	waitfor( notcalled : m, m ) {
+	} or waitfor( notcalled : m, m );
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) waitfor( notcalled : m, m );
+
+	// test when, waitfor and else
+
+	waitfor( notcalled : m, m );
+	or else;
+
+	when( true ) waitfor( notcalled : m, m );
+	or else;
+
+	when( true ) waitfor( notcalled : m, m );
+	or else;
+
+	waitfor( notcalled : m, m ) {
+	} or else {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or else {
+	}
+
+	waitfor( notcalled : m, m );
 	or else {
-		6;
-	}
-
-	//---------------------------------------
-	when( 3 < 3 ) waitfor( f3 : a, a ) {
-		7;
-	}
-	or when( 4 < 3 ) timeout( 101 ) {
-		8;
-	}
-	or when( 5 < 3 ) else {
-		9;
-	}
-
-	//---------------------------------------
-	when( 6 < 3 ) waitfor( f3 : a, a, a ) {
-		10;
-	}
- 	or when( 7 < 3 ) waitfor( f1 : a  ) {
-		11;
-	}
+	}
+
+	when( true ) waitfor( notcalled : m, m );
 	or else {
-		12;
-	}
-
-	//---------------------------------------
-	when( 8 < 3 ) waitfor( f3 : a, a ) {
-		13;
-	}
- 	or waitfor( f1 : a  ) {
-		14;
-	}
-	or when( 9 < 3 ) timeout( 102 ) {
-		15;
-	}
-
-	//---------------------------------------
-	when( 10 < 3 ) waitfor( f1 : a ) {
-		16;
-	}
- 	or waitfor( f2 : a, a ) {
-		17;
-	}
-	or timeout( 103 ) {
-		18;
-	}
-	or when( 11 < 3 ) else {
-		19;
-	}
-}
-
-int main() {}
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or else {
+	}
+
+	waitfor( notcalled : m, m ) {
+	} or else;
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or else;
+
+	waitfor( notcalled : m, m );
+	or when( true ) else;
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) else;
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) else;
+
+	waitfor( notcalled : m, m ) {
+	} or when( true ) else {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) else {
+	}
+
+	waitfor( notcalled : m, m );
+	or when( true ) else {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) else {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) else {
+	}
+
+	waitfor( notcalled : m, m ) {
+	} or when( true ) else;
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) else;
+
+	// test when, waitfor and timeout
+
+	waitfor( notcalled : m, m );
+	or timeout( 3 );
+
+	waitfor( notcalled : m, m );
+	or timeout( 3 );
+
+	when( true ) waitfor( notcalled : m, m );
+	or timeout( 3 );
+
+	waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when ( true ) timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when ( true ) timeout( 3 ) {
+	}
+
+	waitfor( notcalled : m, m );
+	or timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or timeout( 3 ) {
+	}
+
+	when( true ) waitfor( notcalled : m, m );
+	or when( true ) timeout( 3 ) {
+	}
+
+	waitfor( notcalled : m, m ) {
+	} or timeout( 3 );
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or timeout( 3 );
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) timeout( 3 );
+
+	// test when, waitfor, timeout and else
+
+	waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	} or when( true ) else {}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	} or when( true ) else {}
+
+	waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	} or when( true ) else {}
+
+	waitfor( notcalled : m, m ) {
+	} or when( true ) timeout( 3 ) {
+	} or when( true ) else {}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or timeout( 3 ) {
+	} or when( true ) else {}
+
+	waitfor( notcalled : m, m ) {
+	} or when( true ) timeout( 3 ) {
+	} or when( true ) else {}
+
+	when( true ) waitfor( notcalled : m, m ) {
+	} or when( true ) timeout( 3 ) {
+	} or when( true ) else {}
+
+	// test quasi-keywords "or" and "timeout"
+
+	int or = 0, timeout = 0;
+	waitfor( timeout : timeout ) timeout += 1; or timeout( timeout );
+	waitfor( notcalled : or, or ) or += 1; or timeout( or ) 3;
+	when( or ) waitfor( or : m ) { 4; } or timeout( or ) or += 1;
+	when( timeout ) waitfor( notcalled : timeout, timeout ) or += 1; or else timeout += 1;
+	when( or + timeout ) waitfor( or : m ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout += 1;
+	when( 3 ) waitfor( or : or ) 3; or when( or ) waitfor( notcalled : or, or ) 4; or else 4;
+	when( timeout ) waitfor( or : timeout ) 3; or waitfor( notcalled : timeout, or ) 4; or when( or ) timeout( timeout ) 4;
+	when( 3 ) waitfor( or : timeout ) or += 1;
+	or waitfor( or : or ) timeout += 1;
+	or timeout( timeout ) or += 1;
+	or when( 3 ) else or += 1;
+
+	// test else selection
+
+	if ( or > timeout ) waitfor( or : or ) 3;
+	else waitfor( timeout : timeout ) 4;
+}
+
+//Dummy main
+int main( int argc, char const * argv[] ) {
+    #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa waitfor.cfa" //
+// End: //
