Merge branch 'format-work' of https://github.com/callumenator/Dscanner into callumenator-format-work
Conflicts: formatter.d
This commit is contained in:
commit
f4525cad93
4596
formatter.d
4596
formatter.d
File diff suppressed because it is too large
Load Diff
|
@ -1182,6 +1182,8 @@ public:
|
|||
}
|
||||
/** */ Token name;
|
||||
/** */ Initializer initializer;
|
||||
/** */ TypeSuffix[] cstyle;
|
||||
|
||||
mixin OpEquals;
|
||||
}
|
||||
|
||||
|
@ -2164,6 +2166,8 @@ public:
|
|||
/** */ Token name;
|
||||
/** */ bool vararg;
|
||||
/** */ AssignExpression default_;
|
||||
/** */ TypeSuffix[] cstyle;
|
||||
|
||||
mixin OpEquals;
|
||||
}
|
||||
|
||||
|
|
|
@ -1908,10 +1908,19 @@ class ClassFive(A, B) : Super if (someTest()) {}}c;
|
|||
auto id = expect(tok!"identifier");
|
||||
if (id is null) return null;
|
||||
node.name = *id;
|
||||
if (currentIsOneOf(tok!"[", tok!"*"))
|
||||
if (currentIs(tok!"[")) // dmd doesn't accept pointer after identifier
|
||||
{
|
||||
error("C-style variable declarations are not supported.");
|
||||
return null;
|
||||
warn("C-style array declaration.");
|
||||
TypeSuffix[] typeSuffixes;
|
||||
while (moreTokens() && currentIs(tok!"["))
|
||||
{
|
||||
auto suffix = parseTypeSuffix();
|
||||
if (suffix !is null)
|
||||
typeSuffixes ~= suffix;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
node.cstyle = ownArray(typeSuffixes);
|
||||
}
|
||||
if (currentIs(tok!"="))
|
||||
{
|
||||
|
@ -3937,7 +3946,7 @@ invariant() foo();
|
|||
* Parses a Parameter
|
||||
*
|
||||
* $(GRAMMAR $(RULEDEF parameter):
|
||||
* $(RULE parameterAttribute)* $(RULE type) ($(LITERAL Identifier)? $(LITERAL '...') | ($(LITERAL Identifier)? ($(LITERAL '=') $(RULE assignExpression))?))?
|
||||
* $(RULE parameterAttribute)* $(RULE type) (($(LITERAL Identifier) $(RULE typeSuffix)*)? $(LITERAL '...') | ($(LITERAL Identifier)? ($(LITERAL '=') $(RULE assignExpression))?))?
|
||||
* ;)
|
||||
*/
|
||||
Parameter parseParameter()
|
||||
|
@ -3969,6 +3978,19 @@ invariant() foo();
|
|||
advance();
|
||||
node.default_ = parseAssignExpression();
|
||||
}
|
||||
else if (currentIs(tok!"["))
|
||||
{
|
||||
TypeSuffix[] typeSuffixes;
|
||||
while(moreTokens() && currentIs(tok!"["))
|
||||
{
|
||||
auto suffix = parseTypeSuffix();
|
||||
if (suffix !is null)
|
||||
typeSuffixes ~= suffix;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
node.cstyle = ownArray(typeSuffixes);
|
||||
}
|
||||
}
|
||||
else if (currentIs(tok!"..."))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue