Commits

SirAlaran  committed c32c900

Indentation changes

  • Participants
  • Parent commits dbc3158

Comments (0)

Files changed (3)

 	{
 		switch (ch)
 		{
-			case '&': appender.put("&"); break;
-			case '<': appender.put("&lt;"); break;
-			case '>': appender.put("&gt;"); break;
-			default: appender.put(ch);
+		case '&': appender.put("&amp;"); break;
+		case '<': appender.put("&lt;"); break;
+		case '>': appender.put("&gt;"); break;
+		default: appender.put(ch);
 		}
 	}
 }
 	{
 		switch (token.type)
 		{
-			case TokenType.OPERATORS_BEGIN: .. case TokenType.OPERATORS_END:
-				writeTag(token.value, "d_code_op");
-				break;
-			case TokenType.KEYWORDS_BEGIN: .. case TokenType.KEYWORDS_END:
-				writeTag(token.value, "d_code_kw");
-				break;
-			case TokenType.TYPES_BEGIN: .. case TokenType.TYPES_END:
-				writeTag(token.value, "d_code_typ");
-				break;
-			case TokenType.stringLiteral:
-				writeTag(token.value, "d_code_str");
-				break;
-			case TokenType.comment:
-				writeTag(token.value, "d_code_com");
-				break;
-			case TokenType.PROPERTIES_BEGIN: .. case TokenType.PROPERTIES_END:
-				writeTag(token.value, "d_code_prop");
-				break;
-			case TokenType.CONSTANTS_BEGIN: .. case TokenType.CONSTANTS_END:
-				writeTag(token.value, "d_code_const");
-				break;
-			case TokenType.numberLiteral:
-				writeTag(token.value, "d_code_num");
-				break;
-			case TokenType.whitespace:
-				if (tabSize == TabSize.TAB)
-					write(token.value);
-				else
-				{
-					foreach(char ch; token.value)
-						if (ch == '\t')
-							write(tabSize);
-						else
-							write(ch);
-				}
-				break;
-			default:
+		case TokenType.OPERATORS_BEGIN: .. case TokenType.OPERATORS_END:
+			writeTag(token.value, "d_code_op");
+			break;
+		case TokenType.KEYWORDS_BEGIN: .. case TokenType.KEYWORDS_END:
+			writeTag(token.value, "d_code_kw");
+			break;
+		case TokenType.TYPES_BEGIN: .. case TokenType.TYPES_END:
+			writeTag(token.value, "d_code_typ");
+			break;
+		case TokenType.stringLiteral:
+			writeTag(token.value, "d_code_str");
+			break;
+		case TokenType.comment:
+			writeTag(token.value, "d_code_com");
+			break;
+		case TokenType.PROPERTIES_BEGIN: .. case TokenType.PROPERTIES_END:
+			writeTag(token.value, "d_code_prop");
+			break;
+		case TokenType.CONSTANTS_BEGIN: .. case TokenType.CONSTANTS_END:
+			writeTag(token.value, "d_code_const");
+			break;
+		case TokenType.numberLiteral:
+			writeTag(token.value, "d_code_num");
+			break;
+		case TokenType.whitespace:
+			if (tabSize == TabSize.TAB)
 				write(token.value);
+			else
+			{
+				foreach(char ch; token.value)
+					if (ch == '\t')
+						write(tabSize);
+					else
+						write(ch);
+			}
+			break;
+		default:
+			write(token.value);
 		}
 	}
 
 {
 	switch (input)
 	{
-		mixin(expandCases!(options));
-			return true;
-		default:
-			return false;
+	mixin(expandCases!(options));
+		return true;
+	default:
+		return false;
 	}
 }
 
 		auto token = range.front();
 		switch (token.type)
 		{
-			case TokenType.tModule:
-				range.skipBlockStatement();
-				tokens = [];
-				continue;
-			case TokenType.tTemplate:
-				while (range.front() != TokenType.lBrace && !range.empty())
+		case TokenType.tModule:
+			range.skipBlockStatement();
+			tokens = [];
+			continue;
+		case TokenType.tTemplate:
+			while (range.front() != TokenType.lBrace && !range.empty())
+				range.popFront();
+			range.skipBlockStatement();
+			tokens = [];
+			continue;
+		case TokenType.tPublic:
+		case TokenType.tPrivate:
+		case TokenType.tProtected:
+		case TokenType.tPackage:
+		case TokenType.tExport:
+			range.popFront();
+			if (range.front() == TokenType.lBrace)
+				range.pullBlockStatement();
+			else if (range.front() == TokenType.colon)
+				range.popFront();
+			continue;
+		case TokenType.tConst:
+		case TokenType.tAlign:
+		case TokenType.tShared:
+		case TokenType.tImmutable:
+		case TokenType.tInout:
+		case TokenType.tRef:
+			tokens ~= range.popFront();
+			if (range.front() == TokenType.lParen)
+			{
+				tokens[$-1].type = TokenType.identifier;
+				tokens[$-1].value ~= "(";
+				foreach (t; betweenBalancedParens(range))
+					tokens[$-1].value ~= t.value;
+				tokens[$-1].value ~= ")";
+				if (range.front() == TokenType.star)
+				{
 					range.popFront();
-				range.skipBlockStatement();
-				tokens = [];
-				continue;
-			case TokenType.tPublic:
-			case TokenType.tPrivate:
-			case TokenType.tProtected:
-			case TokenType.tPackage:
-			case TokenType.tExport:
-				range.popFront();
-				if (range.front() == TokenType.lBrace)
-					range.pullBlockStatement();
-				else if (range.front() == TokenType.colon)
-					range.popFront();
-				continue;
-			case TokenType.tConst:
-			case TokenType.tAlign:
-			case TokenType.tShared:
-			case TokenType.tImmutable:
-			case TokenType.tInout:
-			case TokenType.tRef:
-				tokens ~= range.popFront();
-				if (range.front() == TokenType.lParen)
+					tokens[$-1].value ~= "*";
+				}
+			}
+			continue;
+		case TokenType.tEnum:
+			tokens = [];
+			Enum e = parseEnum(tokens, range);
+			mod.enums ~= e;
+			tokens = [];
+			continue;
+		case TokenType.tClass:
+			tokens = [];
+			Class c = parseClass(tokens, range);
+			mod.classes ~= c;
+			tokens = [];
+			continue;
+		case TokenType.tStruct:
+			tokens = [];
+			Struct s = parseStruct(tokens, range);
+			mod.structs ~= s;
+			tokens = [];
+			continue;
+		case TokenType.tInterface:
+			tokens = [];
+			types.Iface i = parseInterface(tokens, range);
+			mod.interfaces ~= i;
+			tokens = [];
+			continue;
+		case TokenType.tImport:
+			tokens = [];
+			string imp;
+			Token part;
+			range.popFront();
+			while ((part = range.front()) != TokenType.semicolon && !range.empty())
+			{
+				if (part == TokenType.comma)
 				{
-					tokens[$-1].type = TokenType.identifier;
-					tokens[$-1].value ~= "(";
-					foreach (t; betweenBalancedParens(range))
-						tokens[$-1].value ~= t.value;
-					tokens[$-1].value ~= ")";
-					if (range.front() == TokenType.star)
+					mod.imports ~= imp;
+					imp = "";
+				}
+				else if (part == TokenType.colon)
+				{
+					while(range.front() != TokenType.comma
+						&& range.front() != TokenType.semicolon && !range.empty())
 					{
 						range.popFront();
-						tokens[$-1].value ~= "*";
 					}
 				}
-				continue;
-			case TokenType.tEnum:
-				tokens = [];
-				Enum e = parseEnum(tokens, range);
-				mod.enums ~= e;
-				tokens = [];
-				continue;
-			case TokenType.tClass:
-				tokens = [];
-				Class c = parseClass(tokens, range);
-				mod.classes ~= c;
-				tokens = [];
-				continue;
-			case TokenType.tStruct:
-				tokens = [];
-				Struct s = parseStruct(tokens, range);
-				mod.structs ~= s;
-				tokens = [];
-				continue;
-			case TokenType.tInterface:
-				tokens = [];
-				types.Iface i = parseInterface(tokens, range);
-				mod.interfaces ~= i;
-				tokens = [];
-				continue;
-			case TokenType.tImport:
-				tokens = [];
-				string imp;
-				Token part;
+				else
+					imp ~= part.value;
 				range.popFront();
-				while ((part = range.front()) != TokenType.semicolon && !range.empty())
-				{
-					if (part == TokenType.comma)
-					{
-						mod.imports ~= imp;
-						imp = "";
-					}
-					else if (part == TokenType.colon)
-					{
-						while(range.front() != TokenType.comma
-							&& range.front() != TokenType.semicolon && !range.empty())
-						{
-							range.popFront();
-						}
-					}
-					else
-						imp ~= part.value;
-					range.popFront();
-				}
-				if (range.front() == TokenType.semicolon)
-					range.popFront();
-				mod.imports ~= imp;
-				tokens = [];
-				continue;
-			case TokenType.semicolon:
+			}
+			if (range.front() == TokenType.semicolon)
 				range.popFront();
-				if (tokens.length >= 2)
-				{
-					Variable var = new Variable();
-					var.type = tokens[$ - 2].value;
-					var.name = tokens[$ - 1].value;
-					var.lineNumber = range.getLineNumber();
-					mod.variables ~= var;
-				}
-				tokens = [];
-				continue;
-			case TokenType.assign:
+			mod.imports ~= imp;
+			tokens = [];
+			continue;
+		case TokenType.semicolon:
+			range.popFront();
+			if (tokens.length >= 2)
+			{
+				Variable var = new Variable();
+				var.type = tokens[$ - 2].value;
+				var.name = tokens[$ - 1].value;
+				var.lineNumber = range.getLineNumber();
+				mod.variables ~= var;
+			}
+			tokens = [];
+			continue;
+		case TokenType.assign:
+			range.popFront();
+			if (tokens.length >= 2)
+			{
+				Variable var = new Variable();
+				var.type = tokens[$ - 2].value;
+				var.name = tokens[$ - 1].value;
+				var.lineNumber = range.getLineNumber();
+				mod.variables ~= var;
+			}
+			range.skipBlockStatement();
+			tokens = [];
+			continue;
+		case TokenType.lBrace:
+			range.pullBlockStatement();
+			continue;
+		case TokenType.lParen:
+			Function f = new Function;
+			parseFunction(f, range, tokens);
+			tokens = [];
+			mod.functions ~= f;
+			continue;
+		case TokenType.tIf:
+		case TokenType.tVersion:
+		case TokenType.tExtern:
+			range.popFront();
+			if (range.front() == TokenType.lParen)
+				range.skipBalancedParen();
+			tokens = [];
+			continue;
+		case TokenType.tStatic:
+			range.popFront();
+			continue;
+		case TokenType.tAssert:
+			range.popFront();
+			if (range.front() == TokenType.lParen)
+				range.skipBalancedParen();
+			continue;
+		case TokenType.tAlias:
+			range.skipBlockStatement();
+			tokens = [];
+			continue;
+		case TokenType.tMixin:
+			range.popFront();
+			if (range.front() == TokenType.lParen)
+				range.skipBalancedParen();
+			if (range.front() == TokenType.semicolon)
 				range.popFront();
-				if (tokens.length >= 2)
-				{
-					Variable var = new Variable();
-					var.type = tokens[$ - 2].value;
-					var.name = tokens[$ - 1].value;
-					var.lineNumber = range.getLineNumber();
-					mod.variables ~= var;
-				}
+			tokens = [];
+			continue;
+		case TokenType.tUnittest:
+		case TokenType.tElse:
+			range.popFront();
+			if (range.front() == TokenType.lBrace)
 				range.skipBlockStatement();
-				tokens = [];
-				continue;
-			case TokenType.lBrace:
-				range.pullBlockStatement();
-				continue;
-			case TokenType.lParen:
-				Function f = new Function;
-				parseFunction(f, range, tokens);
-				tokens = [];
-				mod.functions ~= f;
-				continue;
-			case TokenType.tIf:
-			case TokenType.tVersion:
-			case TokenType.tExtern:
-				range.popFront();
-				if (range.front() == TokenType.lParen)
-					range.skipBalancedParen();
-				tokens = [];
-				continue;
-			case TokenType.tStatic:
-				range.popFront();
-				continue;
-			case TokenType.tAssert:
-				range.popFront();
-				if (range.front() == TokenType.lParen)
-					range.skipBalancedParen();
-				continue;
-			case TokenType.tAlias:
-				range.skipBlockStatement();
-				tokens = [];
-				continue;
-			case TokenType.tMixin:
-				range.popFront();
-				if (range.front() == TokenType.lParen)
-					range.skipBalancedParen();
-				if (range.front() == TokenType.semicolon)
-					range.popFront();
-				tokens = [];
-				continue;
-			case TokenType.tUnittest:
-			case TokenType.tElse:
-				range.popFront();
-				if (range.front() == TokenType.lBrace)
-					range.skipBlockStatement();
-				tokens = [];
-				continue;
-			case TokenType.not:
-				if (tokens.length > 0)
-					tokens[$ - 1].value ~= range.popFront().value;
-				else
-					tokens ~= range.popFront();
-				if (range.front() == TokenType.lParen)
-				{
-					tokens[$-1].value ~= "(";
-					foreach(t; betweenBalancedParens(range))
-						tokens[$-1].value ~= t.value;
-					tokens[$-1].value ~= ")";
-				}
-				else
-					tokens[$-1].value ~= "(" ~ range.popFront().value ~ ")";
-				continue;
-			default:
-				tokens ~= token;
-				range.popFront();
-				break;
+			tokens = [];
+			continue;
+		case TokenType.not:
+			if (tokens.length > 0)
+				tokens[$ - 1].value ~= range.popFront().value;
+			else
+				tokens ~= range.popFront();
+			if (range.front() == TokenType.lParen)
+			{
+				tokens[$-1].value ~= "(";
+				foreach(t; betweenBalancedParens(range))
+					tokens[$-1].value ~= t.value;
+				tokens[$-1].value ~= ")";
+			}
+			else
+				tokens[$-1].value ~= "(" ~ range.popFront().value ~ ")";
+			continue;
+		default:
+			tokens ~= token;
+			range.popFront();
+			break;
 		}
 	}
 	return mod;