Commits

SirAlaran committed dbc3158

Added template constraints to class/interface/struct definitions

Comments (0)

Files changed (1)

 		range.skipBalancedParen();
 		while ((f = range.front()) != TokenType.lBrace && !range.empty())
 			range.popFront();
+		f = range.front();
+	}
+	if (f == TokenType.tIf)
+	{
+		range.popFront();
+		f = range.front();
+		if (f == TokenType.lParen)
+			range.skipBalancedParen();
+		f = range.front();
 	}
 	if (f == TokenType.lBrace)
 		parseStructBody(s, range);
 		range.skipBalancedParen();
 		while ((f = range.front()) != TokenType.lBrace && !range.empty())
 			range.popFront();
+		f = range.front();
+	}
+	if (f == TokenType.tIf)
+	{
+		range.popFront();
+		f = range.front();
+		if (f == TokenType.lParen)
+			range.skipBalancedParen();
+		f = range.front();
 	}
 	if (f == TokenType.colon)
 	{
 		range.skipBalancedParen();
 		f = range.front();
 	}
+	if (f == TokenType.tIf)
+	{
+		range.popFront();
+		f = range.front();
+		if (f == TokenType.lParen)
+			range.skipBalancedParen();
+		f = range.front();
+	}
 	if (f == TokenType.colon)
 	{
 		range.popFront();
 			{
 				auto appender = appender!string();
 				appender.put(range.popFront().value);
-				if  (range.front == TokenType.not)
+				if (range.front == TokenType.not)
 				{
 					appender.put(range.popFront().value);
-					if  (range.front == TokenType.lParen)
+					if (range.front == TokenType.lParen)
 					{
 						appender.put("(");
 						foreach(token; betweenBalancedParens(range))
 				continue;
 			case TokenType.tMixin:
 				range.popFront();
-				if  (range.front() == TokenType.lParen)
+				if (range.front() == TokenType.lParen)
 					range.skipBalancedParen();
-				if  (range.front() == TokenType.semicolon)
+				if (range.front() == TokenType.semicolon)
 					range.popFront();
 				tokens = [];
 				continue;
 			case TokenType.tUnittest:
 			case TokenType.tElse:
 				range.popFront();
-				if  (range.front() == TokenType.lBrace)
+				if (range.front() == TokenType.lBrace)
 					range.skipBlockStatement();
 				tokens = [];
 				continue;
 }
 
 /**
- * Returns: the absolute path of the given module, or null if  it could not be
+ * Returns: the absolute path of the given module, or null if it could not be
  *     found.
  */
 string findAbsPath(string[] dirs, string moduleName)