don't use deprecated properties (#894)
This commit is contained in:
parent
d5d6920502
commit
9b171c46d2
2
dub.json
2
dub.json
|
@ -12,7 +12,7 @@
|
||||||
"StdLoggerDisableWarning"
|
"StdLoggerDisableWarning"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libdparse": ">=0.20.0 <0.23.0",
|
"libdparse": ">=0.21.1 <0.23.0",
|
||||||
"dcd:dsymbol": ">=0.14.0 <0.16.0",
|
"dcd:dsymbol": ">=0.14.0 <0.16.0",
|
||||||
"inifiled": "~>1.3.1",
|
"inifiled": "~>1.3.1",
|
||||||
"emsi_containers": "~>0.9.0",
|
"emsi_containers": "~>0.9.0",
|
||||||
|
|
|
@ -28,14 +28,14 @@ final class IfStatementCheck : BaseAnalyzer
|
||||||
|
|
||||||
++depth;
|
++depth;
|
||||||
|
|
||||||
if (ifStatement.expression.items.length == 1
|
if (ifStatement.condition.expression.items.length == 1
|
||||||
&& (cast(AndAndExpression) ifStatement.expression.items[0]) is null)
|
&& (cast(AndAndExpression) ifStatement.condition.expression.items[0]) is null)
|
||||||
{
|
{
|
||||||
redundancyCheck(ifStatement.expression,
|
redundancyCheck(ifStatement.condition.expression,
|
||||||
ifStatement.expression.line, ifStatement.expression.column);
|
ifStatement.condition.expression.line, ifStatement.condition.expression.column);
|
||||||
}
|
}
|
||||||
inIfExpresson = true;
|
inIfExpresson = true;
|
||||||
ifStatement.expression.accept(this);
|
ifStatement.condition.expression.accept(this);
|
||||||
inIfExpresson = false;
|
inIfExpresson = false;
|
||||||
ifStatement.thenStatement.accept(this);
|
ifStatement.thenStatement.accept(this);
|
||||||
if (expressions.length)
|
if (expressions.length)
|
||||||
|
|
|
@ -28,9 +28,9 @@ final class RedundantParenCheck : BaseAnalyzer
|
||||||
override void visit(const IfStatement statement)
|
override void visit(const IfStatement statement)
|
||||||
{
|
{
|
||||||
UnaryExpression unary;
|
UnaryExpression unary;
|
||||||
if (statement.expression is null || statement.expression.items.length != 1)
|
if (statement.condition.expression is null || statement.condition.expression.items.length != 1)
|
||||||
goto end;
|
goto end;
|
||||||
unary = cast(UnaryExpression) statement.expression.items[0];
|
unary = cast(UnaryExpression) statement.condition.expression.items[0];
|
||||||
if (unary is null)
|
if (unary is null)
|
||||||
goto end;
|
goto end;
|
||||||
if (unary.primaryExpression is null)
|
if (unary.primaryExpression is null)
|
||||||
|
|
|
@ -92,10 +92,10 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const WhileStatement whileStatement)
|
override void visit(const WhileStatement whileStatement)
|
||||||
{
|
{
|
||||||
if (whileStatement.expression !is null)
|
if (whileStatement.condition.expression !is null)
|
||||||
{
|
{
|
||||||
interestDepth++;
|
interestDepth++;
|
||||||
whileStatement.expression.accept(this);
|
whileStatement.condition.expression.accept(this);
|
||||||
interestDepth--;
|
interestDepth--;
|
||||||
}
|
}
|
||||||
if (whileStatement.declarationOrStatement !is null)
|
if (whileStatement.declarationOrStatement !is null)
|
||||||
|
@ -136,10 +136,10 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const IfStatement ifStatement)
|
override void visit(const IfStatement ifStatement)
|
||||||
{
|
{
|
||||||
if (ifStatement.expression !is null)
|
if (ifStatement.condition.expression !is null)
|
||||||
{
|
{
|
||||||
interestDepth++;
|
interestDepth++;
|
||||||
ifStatement.expression.accept(this);
|
ifStatement.condition.expression.accept(this);
|
||||||
interestDepth--;
|
interestDepth--;
|
||||||
}
|
}
|
||||||
if (ifStatement.thenStatement !is null)
|
if (ifStatement.thenStatement !is null)
|
||||||
|
|
|
@ -460,15 +460,15 @@ class XMLPrinter : ASTVisitor
|
||||||
output.writeln("<ifStatement>");
|
output.writeln("<ifStatement>");
|
||||||
|
|
||||||
output.writeln("<condition>");
|
output.writeln("<condition>");
|
||||||
if (ifStatement.identifier.type != tok!"")
|
if (ifStatement.condition.identifier.type != tok!"")
|
||||||
{
|
{
|
||||||
if (ifStatement.type is null)
|
if (ifStatement.condition.type is null)
|
||||||
output.writeln("<auto/>");
|
output.writeln("<auto/>");
|
||||||
else
|
else
|
||||||
visit(ifStatement.type);
|
visit(ifStatement.condition.type);
|
||||||
visit(ifStatement.identifier);
|
visit(ifStatement.condition.identifier);
|
||||||
}
|
}
|
||||||
ifStatement.expression.accept(this);
|
ifStatement.condition.expression.accept(this);
|
||||||
output.writeln("</condition>");
|
output.writeln("</condition>");
|
||||||
|
|
||||||
output.writeln("<then>");
|
output.writeln("<then>");
|
||||||
|
|
Loading…
Reference in New Issue