 					//replace code between brackets with an int like {0} so the resulting string can be passed to StringUtil.substitute() with compiledObject as the next parameter
 					output += input.substring(searchIndex, bracketIndex) + '{' + compiledObjects.length + '}';
 					searchIndex = escapeIndex + 1;
-					compiledObjects.push(compileTokens(tokens, false));
+					compiledObjects.push(compileTokens(tokens, true));
 				}
 			}
 			throw new Error("unreachable");

		private static const INDEX_TRUE:int = 1;
		private static const INDEX_FALSE:int = 2;
		
		private static const STATEMENT_IF:String = 'if';
		private static const STATEMENT_ELSE:String = 'else';
		private static const STATEMENT_FOR:String = 'for';
		private static const STATEMENT_EACH:String = 'each';
		private static const STATEMENT_DO:String = 'do';
		private static const STATEMENT_WHILE:String = 'while';
		private static const STATEMENT_RETURN:String = 'return';
		private static const STATEMENT_BREAK:String = 'break';
		private static const STATEMENT_CONTINUE:String = 'continue';
		private static const STATEMENT_SWITCH:String = 'switch';
		private static const STATEMENT_CASE:String = 'case';
		private static const STATEMENT_DEFAULT:String = 'default';
		private static const STATEMENT_THROW:String = 'throw';
		private static const STATEMENT_TRY:String = 'try';
		private static const STATEMENT_CATCH:String = 'catch';
		private static const STATEMENT_FINALLY:String = 'finally';
		
		private static const _statementsWithoutParams:Array = [
			STATEMENT_ELSE, STATEMENT_DO, STATEMENT_RETURN, STATEMENT_BREAK, STATEMENT_CONTINUE,
			STATEMENT_CASE, STATEMENT_DEFAULT, STATEMENT_THROW, STATEMENT_TRY, STATEMENT_FINALLY
		];
		private static const _statementsWithParams:Array = [
			STATEMENT_IF, STATEMENT_FOR, STATEMENT_EACH, STATEMENT_WHILE, STATEMENT_SWITCH, STATEMENT_CATCH
		];
		
		/**
		 * (statement name):String -> (true if requires parentheses):Boolean
		 */
		private static var statements:Object = null;
		
		/**
		 * String->Array.  Examples: "else"->["if"], "while"->["do"], "finally"->["try", "catch"], "catch"->["try"]
		 */
		private static var statementSiblingsLookup:Object = null;
		
		/**
		 * This is the prefix used for the function notation of infix operators.

			
			// now everything to the right of the current statement and its params have been taken care of.
			
			var cfc:CompiledFunctionCall;
			var cc:CompiledConstant = new CompiledConstant(stmt, stmt);
			
			if (stmt == ST_FOR || stmt == ST_FOR_EACH)
			{
				
			}
			
			if (stmt == ST_IF) // if () {} else {}
			{
			}
			switch (stmt)
			{
				case ST_WHILE: // while () {}
					tokens.splice(i, 3, compileFunctionCall(cc, tokens.slice(i + 1, 2)));
					return;
				case ST_IF: // if () {} else {}
					if (tokens[i + 3] == ST_ELSE)
						tokens.splice(i, 5, compileFunctionCall(cc, [ tokens[i + 1], tokens[i + 2], tokens[i + 4] ]));
				case ST_ELSE: // else {}
					
				case ST_BREAK: // break
				case ST_CONTINUE: // continue
					
				case ST_RETURN: // return EXPR
					
				case ST_FOR: // for () {}
				case ST_FOR_EACH: // "for each" () {}
				case ST_DO: // do {} while ()
					
				case ST_TRY: // try {} catch () {} finally {}
				case ST_CATCH: // catch () {}
				case ST_FINALLY: // finally {}
					
				case ST_SWITCH: // switch () {}
				case ST_CASE: // case EXPR :
				case ST_DEFAULT: // default :
					
				default:
					return;
			}
		}
		
		private function assertValidStatementParams(tokens:Array, index:int):void
		{
			var statement:String = tokens[index] as String;
			if (statements[statement]) // requires parameters?
			{
				// statement parameters must be wrapped in operator ';' call
				var params:CompiledFunctionCall = tokens[index + 1] as CompiledFunctionCall;
				if (!params || params.evaluatedMethod != operators[';'])
					throwInvalidSyntax(statement);
				
				var cpl:int = params.compiledParams.length;
				if (statement == ST_FOR || statement == ST_FOR_EACH)
				{
					// 'for' and 'for each' require either 3 or 1 statement params
					if (cpl != 3 && cpl != 1)
						throwInvalidSyntax(statement);
					
					if (cpl == 1)
					{
						// if 'for' or 'for each' has only one param, it must be the 'in' operator
						var cfc:CompiledFunctionCall = params.compiledParams[0] as CompiledFunctionCall;
						if (!cfc || cfc.evaluatedMethod != operators['in'])
							throwInvalidSyntax(statement);
						
						// the 'in' operator must have a variable or property reference as its first parameter
						cfc = cfc.compiledParams[0];
						if (cfc.compiledParams != null || cfc.evaluatedMethod != operators['.']) // not a variable and not a property
							throwInvalidSyntax(statement);
					}
				}
				else if (cpl != 1)
				{
					throwInvalidSyntax(statement);
				}
