 				if (right < 0 || left < 1 || left + 1 == right || right + 1 == tokens.length)
 					break;
 				
+				// false branch includes everything after ':' and up until the next '?', ':', or ','
+				var end:int = right + 2;
+				while (end < tokens.length)
+				{
+					token = tokens[end] as String;
+					if (token && '?:,'.indexOf(token) >= 0)
+						break;
+					end++;
+				}
+				
 				if (debug)
 					trace("compiling conditional branch:", tokens.slice(left - 1, right + 2).join(' '));
+				
+				// condition includes only the token to the left of the '?'
 				var condition:ICompiledObject = compileTokens(tokens.slice(left - 1, left));
 				var trueBranch:ICompiledObject = compileTokens(tokens.slice(left + 1, right));
-				var falseBranch:ICompiledObject = compileTokens(tokens.slice(right + 1, right + 2));
+				var falseBranch:ICompiledObject = compileTokens(tokens.slice(right + 1, end));
 				
 				// optimization: eliminate unnecessary branch
 				var result:ICompiledObject;

					tokens.splice(open - 1, 3, compileOperator('.', compiledParams));
					continue;
				}

				// cut out tokens between brackets
				var subArray:Array = tokens.splice(open + 1, close - open - 1);

			// next step: compile constants and variable names
			for (i = 0; i < tokens.length; i++)
			{
				token = tokens[i] as String;
				// skip tokens that have already been compiled and skip operator tokens
				if (token == null || operators[token] != undefined)
					continue;
