Index: doc/bibliography/pl.bib
===================================================================
--- doc/bibliography/pl.bib	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ doc/bibliography/pl.bib	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -939,6 +939,7 @@
     title	= {\textsf{C}$\mathbf{\forall}$ : Adding Modern Programming Language Features to C},
     year	= 2018,
+    month	= aug,
     journal	= spe,
-    note	= {Accepted, to appear},
+    note	= {http://dx.doi.org/10.1002/spe.2624},
 }
 
@@ -962,5 +963,5 @@
     comment	= {
         The evidence given is thin.
-	}
+    },
 }
 
@@ -1827,5 +1828,5 @@
     key		= {Peter Buhr},
     title	= {CS343},
-    year	= 2017,
+    year	= 2018,
     howpublished= {\href{https://www.student.cs.uwaterloo.ca/~cs343}{https://\-www.student.cs.uwaterloo.ca/\-~cs343}},
 }
@@ -3362,8 +3363,8 @@
     author	= {Peter Buhr and David Dice and Wim H. Hesselink},
     journal	= ccpe,
-    volumeopt	= 30,
-    numberopt	= 4,
+    volume	= 30,
+    number	= 18,
     year	= 2018,
-    month	= may,
+    month	= sep,
     publisher	= {John Wiley \& Sons},
     note	= {\url{https://doi-org.proxy.lib.uwaterloo.ca/10.1002/cpe.4475}}
@@ -3849,5 +3850,5 @@
     keywords	= {concurrency, critical section},
     contributer	= {pabuhr@plg},
-    author	= {Dominic Duggan and G. V. Cormack and John Ophel},
+    author	= {Dominic Duggan and Gordon V. Cormack and John Ophel},
     title	= {Kinded Type Inference for Parametric Overloading},
     journal	= acta,
@@ -5855,5 +5856,5 @@
     keywords	= {Cyclone, existential types, polymorphism, type variables},
     contributer	= {a3moss@plg},
-    author	= {D. Grossman},
+    author	= {Dan Grossman},
     title	= {Quantified Types in an Imperative Language},
     journal	= toplas,
Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ doc/user/user.tex	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Thu Jul 26 17:29:05 2018
-%% Update Count     : 3366
+%% Last Modified On : Fri Aug 31 07:54:50 2018
+%% Update Count     : 3396
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -210,5 +210,5 @@
 Even with all its problems, C continues to be popular because it allows writing software at virtually any level in a computer system without restriction.
 For system programming, where direct access to hardware, storage management, and real-time issues are a requirement, C is usually the only language of choice.
-The TIOBE index~\cite{TIOBE} for July 2018 ranks the top 5 most \emph{popular} programming languages as: \Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail.
+The TIOBE index~\cite{TIOBE} for July 2018 ranks the top five most \emph{popular} programming languages as \Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail.
 The top 3 rankings over the past 30 years are:
 \begin{center}
@@ -351,5 +351,5 @@
 The 2011 C standard plus GNU extensions.
 \item
-\Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]@-fgnu89-inline@}}
+\Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]$-fgnu89-inline$}}
 Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files.
 \end{description}
@@ -455,5 +455,5 @@
 #endif
 
-®#include_next <bfdlink.h>					§\C{// must have internal check for multiple expansion}§
+®#include_next <bfdlink.h>			§\C{// must have internal check for multiple expansion}§
 ®
 #if defined( with ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§
@@ -504,5 +504,5 @@
 
 C, \CC, and Java (and many other programming languages) have no exponentiation operator\index{exponentiation!operator}\index{operator!exponentiation}, \ie $x^y$, and instead use a routine, like \Indexc{pow}, to perform the exponentiation operation.
-\CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@\lstinline@?\?@} and ©?\=?©\index{?\\=?@\lstinline@?\=?@}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.
+\CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@©?\?©} and ©?\=?©\index{?\\=?@©\=?©}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.
 The priority of the exponentiation operator is between the cast and multiplicative operators, so that ©w * (int)x \ (int)y * z© is parenthesized as ©((w * (((int)x) \ ((int)y))) * z)©.
 
@@ -516,5 +516,5 @@
 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
 \end{cfa}
-Parenthesis are necessary for the complex constants or the expression is parsed as ©1.0f+(2.0fi \ 3.0f)+2.0fi©.
+Parenthesis are necessary for complex constants or the expression is parsed as ©1.0f+®(®2.0fi \ 3.0f®)®+2.0fi©.
 The exponentiation operator is available for all the basic types, but for user-defined types, only the integral-computation versions are available.
 For returning an integral value, the user type ©T© must define multiplication, ©*©, and one, ©1©;
@@ -527,15 +527,107 @@
 
 
-%\subsection{\texorpdfstring{\protect\lstinline@if@ Statement}{if Statement}}
-\subsection{\texorpdfstring{\LstKeywordStyle{if} Statement}{if Statement}}
-
-The ©if© expression allows declarations, similar to ©for© declaration expression:
-\begin{cfa}
-if ( int x = f() ) ...						§\C{// x != 0}§
-if ( int x = f(), y = g() ) ...				§\C{// x != 0 \&\& y != 0}§
-if ( int x = f(), y = g(); ®x < y® ) ...	§\C{// relational expression}§
-\end{cfa}
-Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.}
+%\subsection{\texorpdfstring{\protect\lstinline@if@/\protect\lstinline@while@ Statement}{if Statement}}
+\subsection{\texorpdfstring{\LstKeywordStyle{if}/\LstKeywordStyle{while} Statement}{if/while Statement}}
+
+The ©if©/©while© expression allows declarations, similar to ©for© declaration expression.
+(Does not make sense for ©do©-©while©.)
+\begin{cfa}
+if ( ®int x = f()® ) ...					§\C{// x != 0}§
+if ( ®int x = f(), y = g()® ) ...			§\C{// x != 0 \&\& y != 0}§
+if ( ®int x = f(), y = g(); x < y® ) ...	§\C{// relational expression}§
+if ( ®struct S { int i; } x = { f() }; x.i < 4® ) §\C{// relational expression}§
+
+while ( ®int x = f()® ) ...					§\C{// x != 0}§
+while ( ®int x = f(), y = g()® ) ...		§\C{// x != 0 \&\& y != 0}§
+while ( ®int x = f(), y = g(); x < y® ) ... §\C{// relational expression}§
+while ( ®struct S { int i; } x = { f() }; x.i < 4® ) ... §\C{// relational expression}§
+\end{cfa}
+Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if©/©while© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.}
 The scope of the declaration(s) is local to the @if@ statement but exist within both the ``then'' and ``else'' clauses.
+
+
+%\subsection{\texorpdfstring{\protect\lstinline@for@ Statement}{for Statement}}
+\subsection{\texorpdfstring{\LstKeywordStyle{for} Statement}{for Statement}}
+
+The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges.
+An empty conditional implies ©1©.
+The up-to range ©~©\index{~@©~©} means exclusive range [M,N);
+the up-to range ©~=©\index{~=@©~=©} means inclusive range [M,N].
+The down-to range ©-~©\index{-~@©-~©} means exclusive range [N,M);
+the down-to range ©-~=©\index{-~=@©-~=©} means inclusive range [N,M].
+©0© is the implicit start value;
+©1© is the implicit increment value for an up-to range and ©-1© for an implicit down-to range.
+The loop index is polymorphic in the type of the start value or comparison value when start is implicitly ©0©.
+\begin{cquote}
+\begin{tabular}{@{}ll|l@{}}
+\multicolumn{2}{c|}{for control} & \multicolumn{1}{c}{output} \\
+\hline
+\begin{cfa}
+while ®()® { sout | "empty"; break; }
+do { sout | "empty"; break; } while ®()®;
+for ®()® { sout | "empty"; break; }
+for ( ®0® ) { sout | "A"; }
+for ( ®1® ) { sout | "A"; }
+for ( ®10® ) { sout | "A"; }
+for ( ®1 ~= 10 ~ 2® ) { sout | "B"; }
+for ( ®10 -~= 1 ~ -2® ) { sout | "C"; }
+for ( ®0.5 ~ 5.5® ) { sout | "D"; }
+for ( ®5.5 -~ 0.5® ) { sout | "E"; }
+for ( ®i; 10® ) { sout | i; }
+for ( ®i; 1 ~= 10 ~ 2® ) { sout | i; }
+for ( ®i; 10 -~= 1 ~ -2® ) { sout | i; }
+for ( ®i; 0.5 ~ 5.5® ) { sout | i; }
+for ( ®i; 5.5 -~ 0.5® ) { sout | i; }
+for ( ®ui; 2u ~= 10u ~ 2u® ) { sout | ui; }
+for ( ®ui; 10u -~= 2u ~ -2u® ) { sout | ui; }
+int start = 3, comp = 10, inc = 2;
+for ( ®i; start ~ comp ~ inc + 1® ) { sout | i; }
+\end{cfa}
+&
+\begin{cfa}
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+sout | endl;
+
+sout | endl;
+\end{cfa}
+&
+\begin{cfa}
+empty
+empty
+empty
+
+A
+A A A A A A A A A A
+B B B B B
+C C C C C
+D D D D D
+E E E E E
+0 1 2 3 4 5 6 7 8 9
+1 3 5 7 9
+10 8 6 4 2
+0.5 1.5 2.5 3.5 4.5
+5.5 4.5 3.5 2.5 1.5
+2 4 6 8 10
+10 8 6 4 2
+
+3 6 9
+\end{cfa}
+\end{tabular}
+\end{cquote}
 
 
@@ -800,4 +892,13 @@
 
 
+% for ()  => for ( ;; )
+% for ( 10 - t ) => for ( typeof(10 - t) ? = 0 ; ? < 10 - t; ? += 1 ) // using 0 and 1
+% for ( i ; 10 - t ) => for ( typeof(10 - t) i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1
+% for ( T i ; 10 - t ) => for ( T i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1
+% for ( 3~9 ) => for ( int ? = 3 ; ? < 9; ? += 1 ) // using 1
+% for ( i ; 3~9 ) => for ( int i = 3 ; i < 9; i += 1 ) // using 1
+% for ( T i ; 3~9 ) => for ( T i = 3 ; i < 9; i += 1 ) // using 1
+
+
 %\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}}
 \subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}}
@@ -805,5 +906,5 @@
 While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure.
 Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting.
-To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@\lstinline@continue@!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@\lstinline@break@!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java.
+To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@©continue©!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@©break©!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java.
 For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement;
 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement.
@@ -890,5 +991,5 @@
 \end{figure}
 
-Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline@goto@!restricted} restricted in the following ways:
+Both labelled ©continue© and ©break© are a ©goto©\index{goto@©goto©!restricted} restricted in the following ways:
 \begin{itemize}
 \item
Index: driver/as.cc
===================================================================
--- driver/as.cc	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ driver/as.cc	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -5,11 +5,12 @@
 // file "LICENCE" distributed with Cforall.
 // 
-// as.c -- 
+// as.c -- map assembler file, scan for debug information. If found, expand file by one character and insert Cforall
+//         language code on the N line from the start of the debug information.
 // 
 // Author           : Peter A. Buhr
 // Created On       : Wed Aug  1 10:49:42 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 22 17:30:24 2018
-// Update Count     : 93
+// Last Modified On : Sat Sep  8 08:40:16 2018
+// Update Count     : 97
 // 
 
@@ -43,25 +44,27 @@
 	off_t size = mystat.st_size;
 
-	char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
-	if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
+	if ( size ) {										// cannot map 0 sized file
+		char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
+		if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
 
-	if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?
-		// Expand file by one byte to hold 2 character Cforall language code.
-		if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
+		if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?
+			// Expand file by one byte to hold 2 character Cforall language code.
+			if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
 
-		for ( int i = 0; i < 8; i += 1 ) {				// move N (magic) lines forward
-			cursor = strstr( cursor, "\n" ) + 1;
-		} // for
+			for ( int i = 0; i < 8; i += 1 ) {			// move N (magic) lines forward
+				cursor = strstr( cursor, "\n" ) + 1;
+			} // for
 
-		cursor -= 2;									// backup over "c\n" language value
-		if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };
+			cursor -= 2;								// backup over "c\n" language value
+			if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };
 
-		memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
+			memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
 
-		*(cursor) = '2';								// replace C language value with CFA
-		*(cursor + 1) = '5';
+			*(cursor) = '2';							// replace C language value with CFA
+			*(cursor + 1) = '5';
+		} // if
+
+		if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
 	} // if
-
-	if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
 
 	argv[0] = "as";
Index: driver/cc1.cc
===================================================================
--- driver/cc1.cc	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ driver/cc1.cc	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -10,6 +10,6 @@
 // Created On       : Fri Aug 26 14:23:51 2005
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Aug 23 09:48:40 2018
-// Update Count     : 122
+// Last Modified On : Mon Sep  3 16:57:05 2018
+// Update Count     : 125
 //
 
@@ -32,5 +32,4 @@
 string compiler_name( CFA_BACKEND_CC );					// path/name of C compiler
 
-string D__GCC_X__( "-D__GCC_X__=" );
 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" );
 string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" );
@@ -46,5 +45,4 @@
 enum { NumSuffixes = 2 };
 const string suffixes[NumSuffixes] = { "cfa", "hfa", };
-
 
 void suffix( string arg, const char * args[], int & nargs ) {
@@ -116,5 +114,4 @@
 void Stage1( const int argc, const char * const argv[] ) {
 	int code;
-	int i;
 
 	string arg;
@@ -139,17 +136,15 @@
 	cerr << "Stage1" << endl;
 	#endif // __DEBUG_H__
+	checkEnv( args, nargs );							// arguments passed via environment variables
+	#ifdef __DEBUG_H__
+	for ( int i = 1; i < argc; i += 1 ) {
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+	} // for
+	#endif // __DEBUG_H__
 
 	// process all the arguments
 
-	checkEnv( args, nargs );							// arguments passed via environment variables
-
-	for ( i = 1; i < argc; i += 1 ) {
-		#ifdef __DEBUG_H__
-		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-		#endif // __DEBUG_H__
+	for ( int i = 1; i < argc; i += 1 ) {
 		arg = argv[i];
-		#ifdef __DEBUG_H__
-		cerr << "arg:\"" << arg << "\"" << endl;
-		#endif // __DEBUG_H__
 		if ( prefix( arg, "-" ) ) {
 			// strip g++ flags that are inappropriate or cause duplicates in subsequent passes
@@ -185,15 +180,4 @@
 				ncargs += 1;
 				i += 1;									// and the argument
-			// } else if ( prefix( arg, D__GCC_X__ ) ) {
-			// 	args[nargs] = "-x";
-			// 	nargs += 1;
-			// 	args[nargs] = ( *new string( arg.substr( D__GCC_X__.size() ) ) ).c_str(); // pass the flag along
-			// 	nargs += 1;
-			// } else if ( arg == "-D" && prefix( argv[i + 1], D__GCC_X__.substr(2) ) ) {
-			// 	args[nargs] = "-x";
-			// 	nargs += 1;
-			// 	args[nargs] = ( *new string( string( argv[i + 1] ).substr( D__GCC_X__.size() - 2 ) ) ).c_str(); // pass the flag along
-			// 	nargs += 1;
-			// 	i += 1;									// and the argument
 			} else if ( prefix( arg, D__GCC_BPREFIX__ ) ) {
 				bprefix = arg.substr( D__GCC_BPREFIX__.size() );
@@ -251,5 +235,5 @@
 	#ifdef __DEBUG_H__
 	cerr << "args:";
-	for ( i = 1; i < nargs; i += 1 ) {
+	for ( int i = 1; i < nargs; i += 1 ) {
 		cerr << " " << args[i];
 	} // for
@@ -282,5 +266,5 @@
 		#ifdef __DEBUG_H__
 		cerr << "nargs: " << nargs << endl;
-		for ( i = 0; args[i] != NULL; i += 1 ) {
+		for ( int i = 0; args[i] != NULL; i += 1 ) {
 			cerr << args[i] << " ";
 		} // for
@@ -324,5 +308,5 @@
 		#ifdef __DEBUG_H__
 		cerr << "cpp nargs: " << nargs << endl;
-		for ( i = 0; args[i] != NULL; i += 1 ) {
+		for ( int i = 0; args[i] != NULL; i += 1 ) {
 			cerr << args[i] << " ";
 		} // for
@@ -377,5 +361,5 @@
 		#ifdef __DEBUG_H__
 		cerr << "cfa-cpp ncargs: " << o_name << " " << CFA_flag << " " << ncargs << endl;
-		for ( i = 0; cargs[i] != NULL; i += 1 ) {
+		for ( int i = 0; cargs[i] != NULL; i += 1 ) {
 			cerr << cargs[i] << " ";
 		} // for
@@ -407,6 +391,4 @@
 
 void Stage2( const int argc, const char * const * argv ) {
-	int i;
-
 	string arg;
 
@@ -419,17 +401,15 @@
 	cerr << "Stage2" << endl;
 	#endif // __DEBUG_H__
+	checkEnv( args, nargs );							// arguments passed via environment variables
+	#ifdef __DEBUG_H__
+	for ( int i = 1; i < argc; i += 1 ) {
+		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+	} // for
+	#endif // __DEBUG_H__
 
 	// process all the arguments
 
-	checkEnv( args, nargs );							// arguments passed via environment variables
-
-	for ( i = 1; i < argc; i += 1 ) {
-		#ifdef __DEBUG_H__
-		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-		#endif // __DEBUG_H__
+	for ( int i = 1; i < argc; i += 1 ) {
 		arg = argv[i];
-		#ifdef __DEBUG_H__
-		cerr << "arg:\"" << arg << "\"" << endl;
-		#endif // __DEBUG_H__
 		if ( prefix( arg, "-" ) ) {
 			// strip inappropriate flags
@@ -476,5 +456,5 @@
 	#ifdef __DEBUG_H__
 	cerr << "args:";
-	for ( i = 1; i < nargs; i += 1 ) {
+	for ( int i = 1; i < nargs; i += 1 ) {
 		cerr << " " << args[i];
 	} // for
@@ -492,5 +472,5 @@
 	#ifdef __DEBUG_H__
 	cerr << "stage2 nargs: " << nargs << endl;
-	for ( i = 0; args[i] != NULL; i += 1 ) {
+	for ( int i = 0; args[i] != NULL; i += 1 ) {
 		cerr << args[i] << " ";
 	} // for
@@ -506,5 +486,5 @@
 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) {
 	#ifdef __DEBUG_H__
-	for ( int i = 0; env[i] != NULL; i += 1 ) {
+	for ( int int i = 0; env[i] != NULL; i += 1 ) {
 		cerr << env[i] << endl;
 	} // for
Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ driver/cfa.cc	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -10,6 +10,6 @@
 // Created On       : Tue Aug 20 13:44:49 2002
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Aug 23 15:41:55 2018
-// Update Count     : 270
+// Last Modified On : Mon Sep  3 16:47:59 2018
+// Update Count     : 275
 //
 
@@ -43,9 +43,9 @@
 const string suffixes[NumSuffixes] = { "cfa", "hfa", };
 
-void suffix( string arg, const char * args[], int & nargs ) {
+bool suffix( string arg, const char * args[], int & nargs ) {
 	//std::cerr << arg << std::endl;
 	size_t dot = arg.find_last_of( "." );
 	//std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
-	if ( dot == string::npos ) return;
+	if ( dot == string::npos ) return false;
 	string sx = arg.substr( dot + 1 );
 	for ( int i = 0; i < NumSuffixes; i += 1 ) {
@@ -55,7 +55,8 @@
 			args[nargs] = "c";
 			nargs += 1;
-			return;
+			return true;
 		} // if
 	} // for
+	return false;
 } // suffix
 
@@ -128,4 +129,7 @@
 	#ifdef __DEBUG_H__
 	cerr << "CFA:" << endl;
+	for ( int i = 1; i < argc; i += 1 ) {
+	    cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
+	} // for
 	#endif // __DEBUG_H__
 
@@ -133,11 +137,5 @@
 
 	for ( int i = 1; i < argc; i += 1 ) {
-		#ifdef __DEBUG_H__
-		cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;
-		#endif // __DEBUG_H__
 		arg = argv[i];									// convert to string value
-		#ifdef __DEBUG_H__
-		cerr << "arg:\"" << arg << "\"" << endl;
-		#endif // __DEBUG_H__
 		if ( prefix( arg, "-" ) ) {
 			// pass through arguments
@@ -202,19 +200,4 @@
 				args[nargs] = argv[i];					// pass the argument along
 				nargs += 1;
-			} else if ( arg == "-x" ) {
-				xflag = true;
-				args[nargs] = argv[i];					// pass the argument along
-				nargs += 1;
-				i += 1;									// advance to argument
-				args[nargs] = argv[i];					// pass the argument along
-				nargs += 1;
-				// args[nargs] = ( *new string( string("-D__GCC_X__=") + argv[i] ) ).c_str(); // add the argument for -x
-				// nargs += 1;
-			} else if ( prefix( arg, "-x" ) ) {
-				xflag = true;
-				args[nargs] = argv[i];					// pass the argument along
-				nargs += 1;
-				// args[nargs] = ( *new string( string("-D__GCC_X__=") + arg.substr(2) ) ).c_str(); // add the argument for -x
-				// nargs += 1;
 			} else if ( arg == "-w" ) {
 				args[nargs] = argv[i];					// pass the argument along
@@ -298,21 +281,12 @@
 			} // if
 		} else {
-			bool opt = false;
-			if ( ! xflag ) {
-				suffix( arg, args, nargs );				// check suffix
-				// args[nargs] = ( *new string( string("-D__GCC_X__=c") ) ).c_str(); // add the argument for -x
-				// nargs += 1;
-				opt = true;
-			} // if
-			// concatenate other arguments
-			args[nargs] = argv[i];
+			bool cfa = suffix( arg, args, nargs );		// check suffix
+			args[nargs] = argv[i];						// concatenate file
 			nargs += 1;
-			if ( opt ) {
+			if ( cfa ) {
 				args[nargs] = "-x";
 				nargs += 1;
 				args[nargs] = "none";
 				nargs += 1;
-				// args[nargs] = ( *new string( string("-D__GCC_X__=none") ) ).c_str(); // add the argument for -x
-				// nargs += 1;
 			} // if
 			nonoptarg = true;
@@ -320,4 +294,9 @@
 		} // if
 	} // for
+
+    args[nargs] = "-x";					// turn off language
+    nargs += 1;
+    args[nargs] = "none";
+    nargs += 1;
 
 	#ifdef __x86_64__
Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ libcfa/src/heap.cfa	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -1,4 +1,2 @@
-// #comment TD : this file uses both spaces and tabs for indentation
-
 //
 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
@@ -12,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Aug 11 08:22:16 2018
-// Update Count     : 495
+// Last Modified On : Thu Sep  6 09:01:30 2018
+// Update Count     : 513
 //
 
@@ -25,9 +23,9 @@
 
 // #comment TD : Many of these should be merged into math I believe
-#include "bits/align.hfa"									// libPow2
-#include "bits/defs.hfa"									// likely, unlikely
-#include "bits/locks.hfa"									// __spinlock_t
+#include "bits/align.hfa"								// libPow2
+#include "bits/defs.hfa"								// likely, unlikely
+#include "bits/locks.hfa"								// __spinlock_t
 #include "startup.hfa"									// STARTUP_PRIORITY_MEMORY
-#include "stdlib.hfa"										// bsearchl
+#include "stdlib.hfa"									// bsearchl
 #include "malloc.h"
 
@@ -151,12 +149,12 @@
 
 extern "C" {
-void heapAppStart() {									// called by __cfaabi_appready_startup
-	allocFree = 0;
-} // heapAppStart
-
-void heapAppStop() {									// called by __cfaabi_appready_startdown
-	fclose( stdin ); fclose( stdout );
-	checkUnfreed();
-} // heapAppStop
+	void heapAppStart() {								// called by __cfaabi_appready_startup
+		allocFree = 0;
+	} // heapAppStart
+
+	void heapAppStop() {								// called by __cfaabi_appready_startdown
+		fclose( stdin ); fclose( stdout );
+		checkUnfreed();
+	} // heapAppStop
 } // extern "C"
 #endif // __CFA_DEBUG__
@@ -167,14 +165,12 @@
 
 	struct Storage {
-	    struct Header {									// header
+		struct Header {									// header
 			union Kind {
 				struct RealHeader {
 					union {
-						// #comment TD : this code use byte size but the comment uses bit size
-
-						struct {						// 32-bit word => 64-bit header, 64-bit word => 128-bit header
+						struct {						// 4-byte word => 8-byte header, 8-byte word => 16-byte header
 							#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_POINTER__ == 4
 							uint32_t padding;			// unused, force home/blocksize to overlay alignment in fake header
-							#endif // __ORDER_BIG_ENDIAN__ && __U_WORDSIZE__ == 32
+							#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_POINTER__ == 4
 
 							union {
@@ -189,9 +185,7 @@
 							#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_POINTER__ == 4
 							uint32_t padding;			// unused, force home/blocksize to overlay alignment in fake header
-							#endif // __ORDER_LITTLE_ENDIAN__ && __U_WORDSIZE__ == 32
-
+							#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_POINTER__ == 4
 						};
-
-						// #comment TD : C++ code
+						// future code
 						#if BUCKLOCK == LOCKFREE
 						Stack<Storage>::Link next;		// freed block points next freed block of same size (double-wide)
@@ -211,7 +205,7 @@
 				} fake; // FakeHeader
 			} kind; // Kind
-	    } header; // Header
-	    char pad[ALIGN - sizeof( Header )];
-	    char data[0];									// storage
+		} header; // Header
+		char pad[ALIGN - sizeof( Header )];
+		char data[0];									// storage
 	}; // Storage
 
@@ -220,13 +214,13 @@
 	struct FreeHeader {
 		#if BUCKLOCK == SPINLOCK
-	    __spinlock_t lock;								// must be first field for alignment
-	    Storage * freeList;
+		__spinlock_t lock;								// must be first field for alignment
+		Storage * freeList;
 		#elif BUCKLOCK == LOCKFREE
-		// #comment TD : C++ code
-	    StackLF<Storage> freeList;
+		// future code
+		StackLF<Storage> freeList;
 		#else
-			#error undefined lock type for bucket lock
+		#error undefined lock type for bucket lock
 		#endif // SPINLOCK
-	    size_t blockSize;								// size of allocations on this list
+		size_t blockSize;								// size of allocations on this list
 	}; // FreeHeader
 
@@ -249,7 +243,6 @@
 static unsigned int maxBucketsUsed;						// maximum number of buckets in use
 
-// #comment TD : This array is not const but it feels like it should be
 // Powers of 2 are common allocation sizes, so make powers of 2 generate the minimum required size.
-static unsigned int bucketSizes[NoBucketSizes] @= {		// different bucket sizes
+static const unsigned int bucketSizes[NoBucketSizes] @= { // different bucket sizes
 	16, 32, 48, 64,
 	64 + sizeof(HeapManager.Storage), 96, 112, 128, 128 + sizeof(HeapManager.Storage), 160, 192, 224,
@@ -279,5 +272,5 @@
 // #comment TD : The return type of this function should be commented
 static inline bool setMmapStart( size_t value ) {
-	if ( value < pageSize || bucketSizes[NoBucketSizes - 1] < value ) return true;
+  if ( value < pageSize || bucketSizes[NoBucketSizes - 1] < value ) return true;
 	mmapStart = value;									// set global
 
@@ -313,5 +306,5 @@
 	sbrk( (char *)libCeiling( (long unsigned int)End, libAlign() ) - End ); // move start of heap to multiple of alignment
 	heapBegin = heapEnd = sbrk( 0 );					// get new start point
-} // HeapManager
+			   } // HeapManager
 
 
@@ -323,5 +316,5 @@
 	// } // if
 	#endif // __STATISTICS__
-} // ~HeapManager
+				} // ~HeapManager
 
 
@@ -329,5 +322,5 @@
 void memory_startup( void ) {
 	#ifdef __CFA_DEBUG__
-	if ( unlikely( heapBoot ) ) {					// check for recursion during system boot
+	if ( unlikely( heapBoot ) ) {						// check for recursion during system boot
 		// DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT.
 		abort( "boot() : internal error, recursively invoked during system boot." );
@@ -336,7 +329,7 @@
 	#endif // __CFA_DEBUG__
 
-	// #comment TD : This assertion seems redundent with the above code
-	assert( heapManager.heapBegin == 0 );
-	heapManager{};
+	//assert( heapManager.heapBegin != 0 );
+	//heapManager{};
+	if ( heapManager.heapBegin == 0 ) heapManager{};
 } // memory_startup
 
@@ -374,28 +367,27 @@
 	char helpText[512];
 	__cfaabi_dbg_bits_print_buffer( helpText, sizeof(helpText),
-			"\nHeap statistics:\n"
-			"  malloc: calls %u / storage %llu\n"
-			"  calloc: calls %u / storage %llu\n"
-			"  memalign: calls %u / storage %llu\n"
-			"  cmemalign: calls %u / storage %llu\n"
-			"  realloc: calls %u / storage %llu\n"
-			"  free: calls %u / storage %llu\n"
-			"  mmap: calls %u / storage %llu\n"
-			"  munmap: calls %u / storage %llu\n"
-			"  sbrk: calls %u / storage %llu\n",
-			malloc_calls, malloc_storage,
-			calloc_calls, calloc_storage,
-			memalign_calls, memalign_storage,
-			cmemalign_calls, cmemalign_storage,
-			realloc_calls, realloc_storage,
-			free_calls, free_storage,
-			mmap_calls, mmap_storage,
-			munmap_calls, munmap_storage,
-			sbrk_calls, sbrk_storage
+									"\nHeap statistics:\n"
+									"  malloc: calls %u / storage %llu\n"
+									"  calloc: calls %u / storage %llu\n"
+									"  memalign: calls %u / storage %llu\n"
+									"  cmemalign: calls %u / storage %llu\n"
+									"  realloc: calls %u / storage %llu\n"
+									"  free: calls %u / storage %llu\n"
+									"  mmap: calls %u / storage %llu\n"
+									"  munmap: calls %u / storage %llu\n"
+									"  sbrk: calls %u / storage %llu\n",
+									malloc_calls, malloc_storage,
+									calloc_calls, calloc_storage,
+									memalign_calls, memalign_storage,
+									cmemalign_calls, cmemalign_storage,
+									realloc_calls, realloc_storage,
+									free_calls, free_storage,
+									mmap_calls, mmap_storage,
+									munmap_calls, munmap_storage,
+									sbrk_calls, sbrk_storage
 		);
 } // printStats
 
-// #comment TD : Why do we have this?
-static int printStatsXML( FILE * stream ) {
+static int printStatsXML( FILE * stream ) {				// see malloc_info
 	char helpText[512];
 	int len = snprintf( helpText, sizeof(helpText),
@@ -431,6 +423,6 @@
 static inline void noMemory() {
 	abort( "Heap memory exhausted at %zu bytes.\n"
-			"Possible cause is very large memory allocation and/or large amount of unfreed storage allocated by the program or system/library routines.",
-			((char *)(sbrk( 0 )) - (char *)(heapManager.heapBegin)) );
+		   "Possible cause is very large memory allocation and/or large amount of unfreed storage allocated by the program or system/library routines.",
+		   ((char *)(sbrk( 0 )) - (char *)(heapManager.heapBegin)) );
 } // noMemory
 
@@ -444,5 +436,5 @@
 
 static inline bool setHeapExpand( size_t value ) {
-	if ( heapExpand < pageSize ) return true;
+  if ( heapExpand < pageSize ) return true;
 	heapExpand = value;
 	return false;
@@ -453,6 +445,6 @@
 	if ( unlikely( check ) ) {							// bad address ?
 		abort( "Attempt to %s storage %p with address outside the heap.\n"
-				"Possible cause is duplicate free on same block or overwriting of memory.",
-				name, addr );
+			   "Possible cause is duplicate free on same block or overwriting of memory.",
+			   name, addr );
 	} // if
 } // checkHeader
@@ -484,5 +476,5 @@
 
 	#ifdef __CFA_DEBUG__
-			checkHeader( addr < heapBegin || header < (HeapManager.Storage.Header *)heapBegin, name, addr ); // bad low address ?
+	checkHeader( addr < heapBegin || header < (HeapManager.Storage.Header *)heapBegin, name, addr ); // bad low address ?
 	#endif // __CFA_DEBUG__
 
@@ -490,20 +482,20 @@
 	//               It's called as the first statement of both branches of the last if, with the same parameters in all cases
 
-		// header may be safe to dereference
-		fakeHeader( header, size, alignment );
+	// header may be safe to dereference
+	fakeHeader( header, size, alignment );
 	#ifdef __CFA_DEBUG__
-			checkHeader( header < (HeapManager.Storage.Header *)heapBegin || (HeapManager.Storage.Header *)heapEnd < header, name, addr ); // bad address ? (offset could be + or -)
+	checkHeader( header < (HeapManager.Storage.Header *)heapBegin || (HeapManager.Storage.Header *)heapEnd < header, name, addr ); // bad address ? (offset could be + or -)
 	#endif // __CFA_DEBUG__
 
-		freeElem = (HeapManager.FreeHeader *)((size_t)header->kind.real.home & -3);
+	freeElem = (HeapManager.FreeHeader *)((size_t)header->kind.real.home & -3);
 	#ifdef __CFA_DEBUG__
-			if ( freeElem < &freeLists[0] || &freeLists[NoBucketSizes] <= freeElem ) {
-			abort( "Attempt to %s storage %p with corrupted header.\n"
-				 "Possible cause is duplicate free on same block or overwriting of header information.",
-			   		name, addr );
-			} // if
+	if ( freeElem < &freeLists[0] || &freeLists[NoBucketSizes] <= freeElem ) {
+		abort( "Attempt to %s storage %p with corrupted header.\n"
+			   "Possible cause is duplicate free on same block or overwriting of header information.",
+			   name, addr );
+	} // if
 	#endif // __CFA_DEBUG__
-		size = freeElem->blockSize;
-		return false;
+	size = freeElem->blockSize;
+	return false;
 } // headers
 
@@ -521,12 +513,12 @@
 			return 0;
 		} // if
-#ifdef __STATISTICS__
+		#ifdef __STATISTICS__
 		sbrk_calls += 1;
 		sbrk_storage += increase;
-#endif // __STATISTICS__
-#ifdef __CFA_DEBUG__
+		#endif // __STATISTICS__
+		#ifdef __CFA_DEBUG__
 		// Set new memory to garbage so subsequent uninitialized usages might fail.
 		memset( (char *)heapEnd + heapRemaining, '\377', increase );
-#endif // __CFA_DEBUG__
+		#endif // __CFA_DEBUG__
 		rem = heapRemaining + increase - size;
 	} // if
@@ -560,8 +552,8 @@
 
 		#if defined( SPINLOCK )
-			lock( freeElem->lock __cfaabi_dbg_ctx2 );
-			block = freeElem->freeList;						// remove node from stack
+		lock( freeElem->lock __cfaabi_dbg_ctx2 );
+		block = freeElem->freeList;						// remove node from stack
 		#else
-			block = freeElem->freeList.pop();
+		block = freeElem->freeList.pop();
 		#endif // SPINLOCK
 		if ( unlikely( block == 0 ) ) {					// no free block ?
@@ -569,9 +561,10 @@
 			unlock( freeElem->lock );
 			#endif // SPINLOCK
+
 			// Freelist for that size was empty, so carve it out of the heap if there's enough left, or get some more
 			// and then carve it off.
 
 			block = (HeapManager.Storage *)extend( tsize );	// mutual exclusion on call
-			if ( unlikely( block == 0 ) ) return 0;
+  if ( unlikely( block == 0 ) ) return 0;
 			#if defined( SPINLOCK )
 		} else {
@@ -582,9 +575,9 @@
 
 		block->header.kind.real.home = freeElem;		// pointer back to free list of apropriate size
-		} else {											// large size => mmap
+	} else {											// large size => mmap
 		tsize = libCeiling( tsize, pageSize );			// must be multiple of page size
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &mmap_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &mmap_storage, tsize, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &mmap_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &mmap_storage, tsize, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		block = (HeapManager.Storage *)mmap( 0, tsize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, mmapFd, 0 );
@@ -593,23 +586,23 @@
 			abort( "(HeapManager &)0x%p.doMalloc() : internal error, mmap failure, size:%zu error:%d.", &heapManager, tsize, errno );
 		} // if
-#ifdef __CFA_DEBUG__
+		#ifdef __CFA_DEBUG__
 		// Set new memory to garbage so subsequent uninitialized usages might fail.
 		memset( block, '\377', tsize );
-#endif // __CFA_DEBUG__
+		#endif // __CFA_DEBUG__
 		block->header.kind.real.blockSize = tsize;		// storage size for munmap
-		} // if
-
-		void * area = &(block->data);						// adjust off header to user bytes
+	} // if
+
+	void * area = &(block->data);						// adjust off header to user bytes
 
 	#ifdef __CFA_DEBUG__
-			assert( ((uintptr_t)area & (libAlign() - 1)) == 0 ); // minimum alignment ?
-			__atomic_add_fetch( &allocFree, tsize, __ATOMIC_SEQ_CST );
-		if ( traceHeap() ) {
-			enum { BufferSize = 64 };
-			char helpText[BufferSize];
-			int len = snprintf( helpText, BufferSize, "%p = Malloc( %zu ) (allocated %zu)\n", area, size, tsize );
-			// int len = snprintf( helpText, BufferSize, "Malloc %p %zu\n", area, size );
-			__cfaabi_dbg_bits_write( helpText, len );
-		} // if
+	assert( ((uintptr_t)area & (libAlign() - 1)) == 0 ); // minimum alignment ?
+	__atomic_add_fetch( &allocFree, tsize, __ATOMIC_SEQ_CST );
+	if ( traceHeap() ) {
+		enum { BufferSize = 64 };
+		char helpText[BufferSize];
+		int len = snprintf( helpText, BufferSize, "%p = Malloc( %zu ) (allocated %zu)\n", area, size, tsize );
+		// int len = snprintf( helpText, BufferSize, "Malloc %p %zu\n", area, size );
+		__cfaabi_dbg_bits_write( helpText, len );
+	} // if
 	#endif // __CFA_DEBUG__
 
@@ -620,7 +613,7 @@
 static inline void doFree( void * addr ) with ( heapManager ) {
 	#ifdef __CFA_DEBUG__
-		if ( unlikely( heapManager.heapBegin == 0 ) ) {
-			abort( "doFree( %p ) : internal error, called before heap is initialized.", addr );
-		} // if
+	if ( unlikely( heapManager.heapBegin == 0 ) ) {
+		abort( "doFree( %p ) : internal error, called before heap is initialized.", addr );
+	} // if
 	#endif // __CFA_DEBUG__
 
@@ -631,40 +624,40 @@
 	if ( headers( "free", addr, header, freeElem, size, alignment ) ) { // mmapped ?
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &munmap_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &munmap_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &munmap_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &munmap_storage, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		if ( munmap( header, size ) == -1 ) {
 			#ifdef __CFA_DEBUG__
 			abort( "Attempt to deallocate storage %p not allocated or with corrupt header.\n"
-					"Possible cause is invalid pointer.",
-					addr );
+				   "Possible cause is invalid pointer.",
+				   addr );
 			#endif // __CFA_DEBUG__
 		} // if
-		} else {
+	} else {
 		#ifdef __CFA_DEBUG__
-			// Set free memory to garbage so subsequent usages might fail.
-			memset( ((HeapManager.Storage *)header)->data, '\377', freeElem->blockSize - sizeof( HeapManager.Storage ) );
+		// Set free memory to garbage so subsequent usages might fail.
+		memset( ((HeapManager.Storage *)header)->data, '\377', freeElem->blockSize - sizeof( HeapManager.Storage ) );
 		#endif // __CFA_DEBUG__
 
 		#ifdef __STATISTICS__
-			free_storage += size;
+		free_storage += size;
 		#endif // __STATISTICS__
 		#if defined( SPINLOCK )
-			lock( freeElem->lock __cfaabi_dbg_ctx2 );		// acquire spin lock
-			header->kind.real.next = freeElem->freeList;	// push on stack
-			freeElem->freeList = (HeapManager.Storage *)header;
-			unlock( freeElem->lock );						// release spin lock
+		lock( freeElem->lock __cfaabi_dbg_ctx2 );		// acquire spin lock
+		header->kind.real.next = freeElem->freeList;	// push on stack
+		freeElem->freeList = (HeapManager.Storage *)header;
+		unlock( freeElem->lock );						// release spin lock
 		#else
-			freeElem->freeList.push( *(HeapManager.Storage *)header );
+		freeElem->freeList.push( *(HeapManager.Storage *)header );
 		#endif // SPINLOCK
-		} // if
+	} // if
 
 	#ifdef __CFA_DEBUG__
-   		 __atomic_add_fetch( &allocFree, -size, __ATOMIC_SEQ_CST );
-		if ( traceHeap() ) {
-			char helpText[64];
-			int len = snprintf( helpText, sizeof(helpText), "Free( %p ) size:%zu\n", addr, size );
-			__cfaabi_dbg_bits_write( helpText, len );
-		} // if
+	__atomic_add_fetch( &allocFree, -size, __ATOMIC_SEQ_CST );
+	if ( traceHeap() ) {
+		char helpText[64];
+		int len = snprintf( helpText, sizeof(helpText), "Free( %p ) size:%zu\n", addr, size );
+		__cfaabi_dbg_bits_write( helpText, len );
+	} // if
 	#endif // __CFA_DEBUG__
 } // doFree
@@ -674,6 +667,6 @@
 	size_t total = 0;
 	#ifdef __STATISTICS__
-		__cfaabi_dbg_bits_acquire();
-		__cfaabi_dbg_bits_print_nolock( "\nBin lists (bin size : free blocks on list)\n" );
+	__cfaabi_dbg_bits_acquire();
+	__cfaabi_dbg_bits_print_nolock( "\nBin lists (bin size : free blocks on list)\n" );
 	#endif // __STATISTICS__
 	for ( unsigned int i = 0; i < maxBucketsUsed; i += 1 ) {
@@ -695,31 +688,32 @@
 
 		#ifdef __STATISTICS__
-			__cfaabi_dbg_bits_print_nolock( "%7zu, %-7u  ", size, N );
-			if ( (i + 1) % 8 == 0 ) __cfaabi_dbg_bits_print_nolock( "\n" );
+		__cfaabi_dbg_bits_print_nolock( "%7zu, %-7u  ", size, N );
+		if ( (i + 1) % 8 == 0 ) __cfaabi_dbg_bits_print_nolock( "\n" );
 		#endif // __STATISTICS__
 	} // for
 	#ifdef __STATISTICS__
-		__cfaabi_dbg_bits_print_nolock( "\ntotal free blocks:%zu\n", total );
-		__cfaabi_dbg_bits_release();
+	__cfaabi_dbg_bits_print_nolock( "\ntotal free blocks:%zu\n", total );
+	__cfaabi_dbg_bits_release();
 	#endif // __STATISTICS__
 	return (char *)heapEnd - (char *)heapBegin - total;
 } // checkFree
 
-// #comment TD : This is not a good name, plus this feels like it could easily be folded into doMalloc
-static inline void * malloc2( size_t size ) {			// necessary for malloc statistics
-	assert( heapManager.heapBegin != 0 );
+
+static inline void * mallocNoStats( size_t size ) {		// necessary for malloc statistics
+	//assert( heapManager.heapBegin != 0 );
+	if ( unlikely( heapManager.heapBegin == 0 ) ) heapManager{}; // called before memory_startup ?
 	void * area = doMalloc( size );
 	if ( unlikely( area == 0 ) ) errno = ENOMEM;		// POSIX
 	return area;
-} // malloc2
-
-
-static inline void * memalign2( size_t alignment, size_t size ) { // necessary for malloc statistics
-#ifdef __CFA_DEBUG__
+} // mallocNoStats
+
+
+static inline void * memalignNoStats( size_t alignment, size_t size ) { // necessary for malloc statistics
+	#ifdef __CFA_DEBUG__
 	checkAlign( alignment );							// check alignment
-#endif // __CFA_DEBUG__
+	#endif // __CFA_DEBUG__
 
 	// if alignment <= default alignment, do normal malloc as two headers are unnecessary
-	if ( unlikely( alignment <= libAlign() ) ) return malloc2( size );
+  if ( unlikely( alignment <= libAlign() ) ) return mallocNoStats( size );
 
 	// Allocate enough storage to guarantee an address on the alignment boundary, and sufficient space before it for
@@ -732,7 +726,7 @@
 	// subtract libAlign() because it is already the minimum alignment
 	// add sizeof(Storage) for fake header
-	// #comment TD : this is the only place that calls doMalloc without calling malloc2, why ?
+	// #comment TD : this is the only place that calls doMalloc without calling mallocNoStats, why ?
 	char * area = (char *)doMalloc( size + alignment - libAlign() + sizeof(HeapManager.Storage) );
-	if ( unlikely( area == 0 ) ) return area;
+  if ( unlikely( area == 0 ) ) return area;
 
 	// address in the block of the "next" alignment address
@@ -749,34 +743,32 @@
 
 	return user;
-} // memalign2
+} // memalignNoStats
 
 
 extern "C" {
-	// The malloc() function allocates size bytes and returns a pointer to the
-	// allocated memory. The memory is not initialized. If size is 0, then malloc()
-	// returns either NULL, or a unique pointer value that can later be successfully
-	// passed to free().
+	// The malloc() function allocates size bytes and returns a pointer to the allocated memory. The memory is not
+	// initialized. If size is 0, then malloc() returns either NULL, or a unique pointer value that can later be
+	// successfully passed to free().
 	void * malloc( size_t size ) {
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &malloc_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &malloc_storage, size, __ATOMIC_SEQ_CST );
-		#endif // __STATISTICS__
-
-		return malloc2( size );
-		} // malloc
-
-	// The calloc() function allocates memory for an array of nmemb elements of
-	// size bytes each and returns a pointer to the allocated memory. The memory
-	// is set to zero. If nmemb or size is 0, then calloc() returns either NULL,
-	// or a unique pointer value that can later be successfully passed to free().
-		void * calloc( size_t noOfElems, size_t elemSize ) {
+		__atomic_add_fetch( &malloc_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &malloc_storage, size, __ATOMIC_SEQ_CST );
+		#endif // __STATISTICS__
+
+		return mallocNoStats( size );
+	} // malloc
+
+	// The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to
+	// the allocated memory. The memory is set to zero. If nmemb or size is 0, then calloc() returns either NULL, or a
+	// unique pointer value that can later be successfully passed to free().
+	void * calloc( size_t noOfElems, size_t elemSize ) {
 		size_t size = noOfElems * elemSize;
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &calloc_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &calloc_storage, size, __ATOMIC_SEQ_CST );
-		#endif // __STATISTICS__
-
-		char * area = (char *)malloc2( size );
-		if ( unlikely( area == 0 ) ) return 0;
+		__atomic_add_fetch( &calloc_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &calloc_storage, size, __ATOMIC_SEQ_CST );
+		#endif // __STATISTICS__
+
+		char * area = (char *)mallocNoStats( size );
+	  if ( unlikely( area == 0 ) ) return 0;
 
 		HeapManager.Storage.Header * header;
@@ -790,7 +782,7 @@
 			memset( area, '\0', asize - sizeof(HeapManager.Storage) ); // set to zeros
 
-		header->kind.real.blockSize |= 2;		// mark as zero filled
+		header->kind.real.blockSize |= 2;				// mark as zero filled
 		return area;
-		} // calloc
+	} // calloc
 
 	// #comment TD : Document this function
@@ -798,10 +790,10 @@
 		size_t size = noOfElems * elemSize;
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &cmemalign_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &cmemalign_storage, size, __ATOMIC_SEQ_CST );
-		#endif // __STATISTICS__
-
-		char * area = (char *)memalign2( alignment, size );
-		if ( unlikely( area == 0 ) ) return 0;
+		__atomic_add_fetch( &cmemalign_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &cmemalign_storage, size, __ATOMIC_SEQ_CST );
+		#endif // __STATISTICS__
+
+		char * area = (char *)memalignNoStats( alignment, size );
+	  if ( unlikely( area == 0 ) ) return 0;
 		HeapManager.Storage.Header * header;
 		HeapManager.FreeHeader * freeElem;
@@ -811,27 +803,24 @@
 		// Mapped storage is zero filled, but in debug mode mapped memory is scrubbed in doMalloc, so it has to be reset to zero.
 		if ( ! mapped )
-		#endif // __CFA_DEBUG__
+			#endif // __CFA_DEBUG__
 			memset( area, '\0', asize - ( (char *)area - (char *)header ) ); // set to zeros
 		header->kind.real.blockSize |= 2;				// mark as zero filled
 
 		return area;
-		} // cmemalign
-
-	// The realloc() function changes the size of the memory block pointed to by
-	// ptr to size bytes. The contents will be unchanged in the range from the
-	// start of the region up to the minimum of the old and new sizes. If the new
-	// size is larger than the old size, the added memory will not be initialized.
-	// If ptr is NULL, then the call is equivalent to malloc(size), for all values
-	// of size; if size is equal to zero, and ptr is not NULL, then the call is
-	// equivalent to free(ptr). Unless ptr is NULL, it must have been returned by
-	// an earlier call to malloc(), calloc() or realloc(). If the area pointed to
-	// was moved, a free(ptr) is done.
-		void * realloc( void * addr, size_t size ) {
-		#ifdef __STATISTICS__
-			__atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST );
-		#endif // __STATISTICS__
-
-		if ( unlikely( addr == 0 ) ) return malloc2( size ); // special cases
-		if ( unlikely( size == 0 ) ) { free( addr ); return 0; }
+	} // cmemalign
+
+	// The realloc() function changes the size of the memory block pointed to by ptr to size bytes. The contents will be
+	// unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size
+	// is larger than the old size, the added memory will not be initialized.  If ptr is NULL, then the call is
+	// equivalent to malloc(size), for all values of size; if size is equal to zero, and ptr is not NULL, then the call
+	// is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(),
+	// calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done.
+	void * realloc( void * addr, size_t size ) {
+		#ifdef __STATISTICS__
+		__atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST );
+		#endif // __STATISTICS__
+
+	  if ( unlikely( addr == 0 ) ) return mallocNoStats( size ); // special cases
+	  if ( unlikely( size == 0 ) ) { free( addr ); return 0; }
 
 		HeapManager.Storage.Header * header;
@@ -848,5 +837,5 @@
 
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -855,7 +844,7 @@
 			area = memalign( alignment, size );			// create new area
 		} else {
-			area = malloc2( size );	// create new area
+			area = mallocNoStats( size );				// create new area
 		} // if
-		if ( unlikely( area == 0 ) ) return 0;
+	  if ( unlikely( area == 0 ) ) return 0;
 		if ( unlikely( header->kind.real.blockSize & 2 ) ) { // previous request zero fill (calloc/cmemalign) ?
 			assert( (header->kind.real.blockSize & 1) == 0 );
@@ -864,5 +853,5 @@
 			// Mapped storage is zero filled, but in debug mode mapped memory is scrubbed in doMalloc, so it has to be reset to zero.
 			if ( ! mapped )
-			#endif // __CFA_DEBUG__
+				#endif // __CFA_DEBUG__
 				memset( (char *)area + usize, '\0', asize - ( (char *)area - (char *)header ) - usize ); // zero-fill back part
 			header->kind.real.blockSize |= 2;			// mark new request as zero fill
@@ -874,9 +863,7 @@
 
 
-	// The obsolete function memalign() allocates size bytes and returns
-	// a pointer to the allocated memory. The memory address will be a
-	// multiple of alignment, which must be a power of two.
-	void * memalign( size_t alignment, size_t size ) __attribute__ ((deprecated));
-		void * memalign( size_t alignment, size_t size ) {
+	// The obsolete function memalign() allocates size bytes and returns a pointer to the allocated memory. The memory
+	// address will be a multiple of alignment, which must be a power of two.
+	void * memalign( size_t alignment, size_t size ) {
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &memalign_calls, 1, __ATOMIC_SEQ_CST );
@@ -884,11 +871,11 @@
 		#endif // __STATISTICS__
 
-		void * area = memalign2( alignment, size );
+		void * area = memalignNoStats( alignment, size );
 
 		return area;
-		} // memalign
-
-	// The function aligned_alloc() is the same as memalign(), except for
-	// the added restriction that size should be a multiple of alignment.
+	} // memalign
+
+	// The function aligned_alloc() is the same as memalign(), except for the added restriction that size should be a
+	// multiple of alignment.
 	void * aligned_alloc( size_t alignment, size_t size ) {
 		return memalign( alignment, size );
@@ -896,20 +883,17 @@
 
 
-	// The function posix_memalign() allocates size bytes and places the address
-	// of the allocated memory in *memptr. The address of the allocated memory
-	// will be a multiple of alignment, which must be a power of two and a multiple
-	// of sizeof(void *). If size is 0, then posix_memalign() returns either NULL,
-	// or a unique pointer value that can later be successfully passed to free(3).
+	// The function posix_memalign() allocates size bytes and places the address of the allocated memory in *memptr. The
+	// address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of
+	// sizeof(void *). If size is 0, then posix_memalign() returns either NULL, or a unique pointer value that can later
+	// be successfully passed to free(3).
 	int posix_memalign( void ** memptr, size_t alignment, size_t size ) {
-		if ( alignment < sizeof(void *) || ! libPow2( alignment ) ) return EINVAL; // check alignment
+	  if ( alignment < sizeof(void *) || ! libPow2( alignment ) ) return EINVAL; // check alignment
 		* memptr = memalign( alignment, size );
-		if ( unlikely( * memptr == 0 ) ) return ENOMEM;
+	  if ( unlikely( * memptr == 0 ) ) return ENOMEM;
 		return 0;
 	} // posix_memalign
 
-	// The obsolete function valloc() allocates size bytes and returns a pointer
-	// to the allocated memory. The memory address will be a multiple of the page size.
-	// It is equivalent to memalign(sysconf(_SC_PAGESIZE),size).
-	void * valloc( size_t size ) __attribute__ ((deprecated));
+	// The obsolete function valloc() allocates size bytes and returns a pointer to the allocated memory. The memory
+	// address will be a multiple of the page size.  It is equivalent to memalign(sysconf(_SC_PAGESIZE),size).
 	void * valloc( size_t size ) {
 		return memalign( pageSize, size );
@@ -917,11 +901,10 @@
 
 
-	// The free() function frees the memory space pointed to by ptr, which must
-	// have been returned by a previous call to malloc(), calloc() or realloc().
-	// Otherwise, or if free(ptr) has already been called before, undefined
-	// behavior occurs. If ptr is NULL, no operation is performed.
+	// The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to
+	// malloc(), calloc() or realloc().  Otherwise, or if free(ptr) has already been called before, undefined behavior
+	// occurs. If ptr is NULL, no operation is performed.
 	void free( void * addr ) {
 		#ifdef __STATISTICS__
-			__atomic_add_fetch( &free_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &free_calls, 1, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -931,9 +914,9 @@
 		if ( unlikely( addr == 0 ) ) {					// special case
 			#ifdef __CFA_DEBUG__
-				if ( traceHeap() ) {
-					#define nullmsg "Free( 0x0 ) size:0\n"
-					// Do not debug print free( 0 ), as it can cause recursive entry from sprintf.
-					__cfaabi_dbg_bits_write( nullmsg, sizeof(nullmsg) - 1 );
-				} // if
+			if ( traceHeap() ) {
+				#define nullmsg "Free( 0x0 ) size:0\n"
+				// Do not debug print free( 0 ), as it can cause recursive entry from sprintf.
+				__cfaabi_dbg_bits_write( nullmsg, sizeof(nullmsg) - 1 );
+			} // if
 			#endif // __CFA_DEBUG__
 			return;
@@ -943,32 +926,30 @@
 	} // free
 
-	// The mallopt() function adjusts parameters that control the behavior of the
-	// memory-allocation functions (see malloc(3)). The param argument specifies
-	// the parameter to be modified, and value specifies the new value for that
+	// The mallopt() function adjusts parameters that control the behavior of the memory-allocation functions (see
+	// malloc(3)). The param argument specifies the parameter to be modified, and value specifies the new value for that
 	// parameter.
-		int mallopt( int option, int value ) {
+	int mallopt( int option, int value ) {
 		choose( option ) {
-			case M_TOP_PAD:
-				if ( setHeapExpand( value ) ) fallthru default;
-			case M_MMAP_THRESHOLD:
-				if ( setMmapStart( value ) ) fallthru default;
-			default:
-				// #comment TD : 1 for unsopported feels wrong
-				return 1;									// success, or unsupported
+		  case M_TOP_PAD:
+			if ( setHeapExpand( value ) ) fallthru default;
+		  case M_MMAP_THRESHOLD:
+			if ( setMmapStart( value ) ) fallthru default;
+		  default:
+			// #comment TD : 1 for unsopported feels wrong
+			return 1;									// success, or unsupported
 		} // switch
 		return 0;										// error
 	} // mallopt
 
-	// The malloc_trim() function attempts to release free memory at the top
-	// of the heap (by calling sbrk(2) with a suitable argument).
+	// The malloc_trim() function attempts to release free memory at the top of the heap (by calling sbrk(2) with a
+	// suitable argument).
 	int malloc_trim( size_t ) {
 		return 0;										// => impossible to release memory
 	} // malloc_trim
 
-	// The malloc_usable_size() function returns the number of usable bytes in the
-	// block pointed to by ptr, a pointer to a block of memory allocated by
-	// malloc(3) or a related function.
-		size_t malloc_usable_size( void * addr ) {
-		if ( unlikely( addr == 0 ) ) return 0;			// null allocation has 0 size
+	// The malloc_usable_size() function returns the number of usable bytes in the block pointed to by ptr, a pointer to
+	// a block of memory allocated by malloc(3) or a related function.
+	size_t malloc_usable_size( void * addr ) {
+	  if ( unlikely( addr == 0 ) ) return 0;			// null allocation has 0 size
 
 		HeapManager.Storage.Header * header;
@@ -982,7 +963,7 @@
 
 
-		// #comment TD : Document this function
+    // The malloc_alignment() function returns the alignment of the allocation.
 	size_t malloc_alignment( void * addr ) {
-		if ( unlikely( addr == 0 ) ) return libAlign();	// minimum alignment
+	  if ( unlikely( addr == 0 ) ) return libAlign();	// minimum alignment
 		HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage) );
 		if ( (header->kind.fake.alignment & 1) == 1 ) {	// fake header ?
@@ -991,10 +972,10 @@
 			return libAlign ();							// minimum alignment
 		} // if
-		} // malloc_alignment
-
-
-		// #comment TD : Document this function
+	} // malloc_alignment
+
+
+    // The malloc_zero_fill() function returns true if the allocation is zero filled, i.e., initially allocated by calloc().
 	bool malloc_zero_fill( void * addr ) {
-		if ( unlikely( addr == 0 ) ) return false;		// null allocation is not zero fill
+	  if ( unlikely( addr == 0 ) ) return false;		// null allocation is not zero fill
 
 		HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage) );
@@ -1003,28 +984,30 @@
 		} // if
 		return (header->kind.real.blockSize & 2) != 0;	// zero filled (calloc/cmemalign) ?
-		} // malloc_zero_fill
-
-
-	// #comment TD : Document this function
+	} // malloc_zero_fill
+
+
+    // The malloc_stats() function prints (on default standard error) statistics about memory allocated by malloc(3) and
+    // related functions.
 	void malloc_stats( void ) {
 		#ifdef __STATISTICS__
-			printStats();
-			if ( checkFree() ) checkFree( heapManager );
-		#endif // __STATISTICS__
-		} // malloc_stats
-
-	// #comment TD : Document this function
-		int malloc_stats_fd( int fd ) {
-		#ifdef __STATISTICS__
-			int temp = statfd;
-			statfd = fd;
-			return temp;
+		printStats();
+		if ( checkFree() ) checkFree( heapManager );
+		#endif // __STATISTICS__
+	} // malloc_stats
+
+	// The malloc_stats_fd() function changes the file descripter where malloc_stats() writes the statistics.
+	int malloc_stats_fd( int fd ) {
+		#ifdef __STATISTICS__
+		int temp = statfd;
+		statfd = fd;
+		return temp;
 		#else
-			return -1;
-		#endif // __STATISTICS__
-		} // malloc_stats_fd
-
-
-	// #comment TD : Document this function
+		return -1;
+		#endif // __STATISTICS__
+	} // malloc_stats_fd
+
+	// The malloc_info() function exports an XML string that describes the current state of the memory-allocation
+	// implementation in the caller.  The string is printed on the file stream stream.  The exported string includes
+	// information about all arenas (see malloc(3)).
 	int malloc_info( int options, FILE * stream ) {
 		return printStatsXML( stream );
@@ -1032,11 +1015,17 @@
 
 
-	// #comment TD : What are these two functions for?
+	// The malloc_get_state() function records the current state of all malloc(3) internal bookkeeping variables (but
+	// not the actual contents of the heap or the state of malloc_hook(3) functions pointers).  The state is recorded in
+	// a system-dependent opaque data structure dynamically allocated via malloc(3), and a pointer to that data
+	// structure is returned as the function result.  (It is the caller's responsibility to free(3) this memory.)
 	void * malloc_get_state( void ) {
-		return 0;
+		return 0;										// unsupported
 	} // malloc_get_state
 
+
+	// The malloc_set_state() function restores the state of all malloc(3) internal bookkeeping variables to the values
+	// recorded in the opaque data structure pointed to by state.
 	int malloc_set_state( void * ptr ) {
-		return 0;
+		return 0;										// unsupported
 	} // malloc_set_state
 } // extern "C"
Index: src/Parser/lex.ll
===================================================================
--- src/Parser/lex.ll	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ src/Parser/lex.ll	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -10,6 +10,6 @@
  * Created On       : Sat Sep 22 08:58:10 2001
  * Last Modified By : Peter A. Buhr
- * Last Modified On : Wed Aug  8 17:23:17 2018
- * Update Count     : 685
+ * Last Modified On : Wed Aug 29 15:02:41 2018
+ * Update Count     : 686
  */
 
@@ -410,6 +410,8 @@
 ">>="			{ NAMEDOP_RETURN(RSassign); }
 
-"~="			{ NAMEDOP_RETURN(Erange); }				// CFA
 "@="			{ NAMEDOP_RETURN(ATassign); }			// CFA
+"~="			{ NAMEDOP_RETURN(ErangeUpEq); }			// CFA
+"-~"			{ NAMEDOP_RETURN(ErangeDown); }			// CFA
+"-~="			{ NAMEDOP_RETURN(ErangeDownEq); }		// CFA
 
 				/* CFA, operator identifier */
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ src/Parser/parser.yy	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug  8 17:50:07 2018
-// Update Count     : 3998
+// Last Modified On : Thu Aug 30 17:02:25 2018
+// Update Count     : 4029
 //
 
@@ -186,5 +186,13 @@
 } // fieldDecl
 
+ExpressionNode *forInc( const OperKinds op ) {
+	return new ExpressionNode( build_constantInteger( *new string( op == OperKinds::LThan || op == OperKinds::LEThan ? "1" : "-1" ) ) );
+} // forInc
+
 ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
+	ConstantExpr *constant = dynamic_cast<ConstantExpr *>(type->get_expr());
+	if ( constant && (constant->get_constant()->get_value() == "0" || constant->get_constant()->get_value() == "1") ) {
+    	type = new ExpressionNode( new CastExpr( maybeMoveBuild< Expression >(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
+	} // if
 	return new ForCtrl(
 		distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ),
@@ -214,6 +222,5 @@
 
 // Types declaration for productions
-%union
-{
+%union {
 	Token tok;
 	ParseNode * pn;
@@ -290,5 +297,5 @@
 %token ANDassign	ERassign	ORassign				// &=	^=	|=
 
-%token Erange											// ~=
+%token ErangeUpEq	ErangeDown	ErangeDownEq			// ~=	-~	-~=
 %token ATassign											// @=
 
@@ -1138,10 +1145,10 @@
 				$$ = new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr );
 			} else {
-				$$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $1->clone(),
-							 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+				$$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
+							  OperKinds::LThan, $1->clone(), forInc( OperKinds::LThan ) );
 			} // if
 		}
 	| constant_expression inclexcl constant_expression	// CFA
-		{ $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
+		{ $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, forInc( $2 ) ); }
 	| constant_expression inclexcl constant_expression '~' constant_expression // CFA
 		{ $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); }
@@ -1154,6 +1161,6 @@
 			} else {
 				if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) {
-					$$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $3->clone(),
-								 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+					$$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
+								  OperKinds::LThan, $3->clone(), forInc( OperKinds::LThan ) );
 				} else {
 					SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr;
@@ -1167,5 +1174,5 @@
 			} else {
 				if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) {
-					$$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) );
+					$$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, forInc( $4 ) );
 				} else {
 					SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr;
@@ -1194,6 +1201,10 @@
 	'~'
 		{ $$ = OperKinds::LThan; }
-	| Erange
+	| ErangeUpEq
 		{ $$ = OperKinds::LEThan; }
+	| ErangeDown
+		{ $$ = OperKinds::GThan; }
+	| ErangeDownEq
+		{ $$ = OperKinds::GEThan; }
  	;
 
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ src/SymTab/Validate.cc	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -403,24 +403,5 @@
 			assert( aggr ); // TODO: need to handle forward declarations
 			for ( Declaration * member : aggr->members ) {
-				if ( StructInstType * inst = dynamic_cast< StructInstType * >( child ) ) {
-					if ( StructDecl * aggr = dynamic_cast< StructDecl * >( member ) ) {
-						if ( aggr->name == inst->name ) {
-							// TODO: is this case, and other non-TypeInstType cases, necessary?
-							return new StructInstType( qualType->get_qualifiers(), aggr );
-						}
-					}
-				} else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( child ) ) {
-					if ( UnionDecl * aggr = dynamic_cast< UnionDecl * > ( member ) ) {
-						if ( aggr->name == inst->name ) {
-							return new UnionInstType( qualType->get_qualifiers(), aggr );
-						}
-					}
-				} else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( child ) ) {
-					if ( EnumDecl * aggr = dynamic_cast< EnumDecl * > ( member ) ) {
-						if ( aggr->name == inst->name ) {
-							return new EnumInstType( qualType->get_qualifiers(), aggr );
-						}
-					}
-				} else if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) {
+				if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) {
 					// name on the right is a typedef
 					if ( NamedTypeDecl * aggr = dynamic_cast< NamedTypeDecl * > ( member ) ) {
@@ -429,4 +410,6 @@
 							Type * ret = aggr->base->clone();
 							ret->get_qualifiers() = qualType->get_qualifiers();
+							TypeSubstitution sub = parent->genericSubstitution();
+							sub.apply(ret);
 							return ret;
 						}
Index: tests/.expect/forctrl.txt
===================================================================
--- tests/.expect/forctrl.txt	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ tests/.expect/forctrl.txt	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -2,12 +2,20 @@
 empty
 empty
-X X X X X X X X X X
-Y Y Y Y Y
-Z Z Z Z Z
+
+A
+A A
+A A A A A A A A A A
+B B B B B
+C C C C C
+D D D D D
+E E E E E
 0 1 2 3 4 5 6 7 8 9
 0 1 2 3 4 5 6 7 8 9
+1 3 5 7 9
+10 8 6 4 2
 0.5 1.5 2.5 3.5 4.5
+5.5 4.5 3.5 2.5 1.5
 2 4 6 8 10
-2 4 6 8 10
+10 8 6 4 2
 3 6 9
 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
Index: tests/forctrl.c
===================================================================
--- tests/forctrl.c	(revision 0cf9ffd4b19ddc023e170aa05300ca4f16672d33)
+++ tests/forctrl.c	(revision bedb40e8bb071348ef1a3fb3ce5c3f1fa8c1d173)
@@ -10,6 +10,6 @@
 // Created On       : Wed Aug  8 18:32:59 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Aug 16 09:25:47 2018
-// Update Count     : 6
+// Last Modified On : Thu Aug 30 17:12:12 2018
+// Update Count     : 43
 // 
 
@@ -33,12 +33,26 @@
 	do { sout | "empty"; break; } while ();	sout | endl;
 	for () { sout | "empty"; break; }		sout | endl;
-	for ( 10 ) { sout | "X"; }				sout | endl;
-	for ( 0.5 ~ 5.5 ) { sout | "Y"; }		sout | endl;
-	for ( 2 ~= 10 ~ 2 ) { sout | "Z"; }		sout | endl;
+
+	for ( 0 ) { sout | "A"; }				sout | endl;
+	for ( 1 ) { sout | "A"; }				sout | endl;
+	for ( 2 ) { sout | "A"; }				sout | endl;
+	for ( 10 ) { sout | "A"; }				sout | endl;
+
+	for ( 1 ~= 10 ~ 2 ) { sout | "B"; }		sout | endl;
+	for ( 10 -~= 1 ~ -2 ) { sout | "C"; }	sout | endl;
+	for ( 0.5 ~ 5.5 ) { sout | "D"; }		sout | endl;
+	for ( 5.5 -~ 0.5 ) { sout | "E"; }		sout | endl;
+
 	for ( i; 10 ) { sout | i; }				sout | endl;
 	for ( j; 10 ) { sout | j; }				sout | endl;
+
+	for ( i; 1 ~= 10 ~ 2 ) { sout | i; }	sout | endl;
+	for ( i; 10 -~= 1 ~ -2 ) { sout | i; }	sout | endl;
 	for ( i; 0.5 ~ 5.5 ) { sout | i; }		sout | endl;
-	for ( i; 2 ~= 10 ~ 2 ) { sout | i; }	sout | endl;
+	for ( i; 5.5 -~ 0.5 ) { sout | i; }		sout | endl;
+
 	for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; } sout | endl;
+	for ( ui; 10u -~= 2u ~ -2u ) { sout | ui; } sout | endl;
+
 	int start = 3, comp = 10, inc = 2;
 	for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | endl;
