Whitespace cleanup

This commit is contained in:
Hackerpilot 2014-04-29 15:51:25 -07:00
parent 9722183249
commit 88883e6e0f
2 changed files with 33 additions and 34 deletions

View File

@ -1873,12 +1873,12 @@ final class LinkageAttribute : ASTNode
public: public:
override void accept(ASTVisitor visitor) const override void accept(ASTVisitor visitor) const
{ {
version (DIP61) mixin (visitIfNotNull!(identifier, identifierChain)); version (DIP61) mixin (visitIfNotNull!(identifier, identifierChain));
else mixin (visitIfNotNull!(identifier)); else mixin (visitIfNotNull!(identifier));
} }
/** */ Token identifier; /** */ Token identifier;
/** */ bool hasPlusPlus; /** */ bool hasPlusPlus;
version (DIP61) /** */ IdentifierChain identifierChain; version (DIP61) /** */ IdentifierChain identifierChain;
mixin OpEquals; mixin OpEquals;
} }

View File

@ -113,7 +113,7 @@ class Parser
node.linkageAttribute = parseLinkageAttribute(); node.linkageAttribute = parseLinkageAttribute();
} }
warn("Prefer the new \"'alias' identifier '=' type ';'\" syntax" warn("Prefer the new \"'alias' identifier '=' type ';'\" syntax"
~ " to the old \"'alias' type identifier ';'\" syntax"); ~ " to the old \"'alias' type identifier ';'\" syntax");
if ((node.type = parseType()) is null) return null; if ((node.type = parseType()) is null) return null;
auto ident = expect(tok!"identifier"); auto ident = expect(tok!"identifier");
if (ident is null) if (ident is null)
@ -1982,14 +1982,13 @@ class ClassFour(A, B) if (someTest()) : Super {}}c;
if (currentIs(tok!";")) if (currentIs(tok!";"))
advance(); advance();
else else
{ {
MemberFunctionAttribute[] memberFunctionAttributes; MemberFunctionAttribute[] memberFunctionAttributes;
while(moreTokens() && currentIsMemberFunctionAttribute()) while(moreTokens() && currentIsMemberFunctionAttribute())
memberFunctionAttributes ~= parseMemberFunctionAttribute(); memberFunctionAttributes ~= parseMemberFunctionAttribute();
node.memberFunctionAttributes = ownArray(memberFunctionAttributes); node.memberFunctionAttributes = ownArray(memberFunctionAttributes);
node.functionBody = parseFunctionBody();
node.functionBody = parseFunctionBody(); }
}
return node; return node;
} }
@ -3414,11 +3413,11 @@ invariant() foo();
{ {
advance(); advance();
node.hasPlusPlus = true; node.hasPlusPlus = true;
version(DIP61) if (currentIs(tok!",")) version(DIP61) if (currentIs(tok!","))
{ {
advance(); advance();
node.identifierChain = parseIdentifierChain(); node.identifierChain = parseIdentifierChain();
} }
} }
expect(tok!")"); expect(tok!")");
return node; return node;
@ -4545,18 +4544,18 @@ q{(int a, ...)
if (!currentIs(tok!"]")) if (!currentIs(tok!"]"))
{ {
node.lower = parseAssignExpression(); node.lower = parseAssignExpression();
if (node.lower is null) if (node.lower is null)
{ {
error("assignExpression expected"); error("assignExpression expected");
return null; return null;
} }
expect(tok!".."); expect(tok!"..");
node.upper = parseAssignExpression(); node.upper = parseAssignExpression();
if (node.upper is null) if (node.upper is null)
{ {
error("assignExpression expected"); error("assignExpression expected");
return null; return null;
} }
} }
if (expect(tok!"]") is null) return null; if (expect(tok!"]") is null) return null;
return node; return node;
@ -4810,13 +4809,13 @@ q{(int a, ...)
mixin(traceEnterAndExit!(__FUNCTION__)); mixin(traceEnterAndExit!(__FUNCTION__));
auto node = allocate!StructInitializer; auto node = allocate!StructInitializer;
expect(tok!"{"); expect(tok!"{");
if (currentIs(tok!"}")) if (currentIs(tok!"}"))
advance(); advance();
else else
{ {
node.structMemberInitializers = parseStructMemberInitializers(); node.structMemberInitializers = parseStructMemberInitializers();
expect(tok!"}"); expect(tok!"}");
} }
return node; return node;
} }
@ -6349,7 +6348,7 @@ protected:
case tok!"abstract": case tok!"abstract":
case tok!"pure": case tok!"pure":
case tok!"nothrow": case tok!"nothrow":
return true; return true;
mixin(BASIC_TYPE_CASES); mixin(BASIC_TYPE_CASES);
return !peekIs(tok!"."); return !peekIs(tok!".");
case tok!"case": case tok!"case":