Skip to content

Commit f4dec41

Browse files
committed
Upgrade libdparse and DCD
1 parent dc907e4 commit f4dec41

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

DCD

Submodule DCD updated 70 files

dub.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"dependencies": {
1414
"libdparse": ">=0.23.1 <0.26.0",
15-
"dcd:dsymbol": ">=0.16.0-beta.2 <0.17.0",
15+
"dcd:dsymbol": ">=0.16.2 <0.17.0",
1616
"inifiled": "~>1.3.1",
1717
"emsi_containers": "~>0.9.0",
1818
"libddoc": "~>0.8.0"

dub.selections.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"fileVersion": 1,
33
"versions": {
4-
"dcd": "0.16.0-beta.2",
4+
"dcd": "0.16.2",
55
"dsymbol": "0.13.0",
66
"emsi_containers": "0.9.0",
77
"inifiled": "1.3.3",
88
"libddoc": "0.8.0",
9-
"libdparse": "0.25.0",
9+
"libdparse": "0.25.1",
1010
"stdx-allocator": "2.77.5"
1111
}
1212
}

libdparse

src/dscanner/analysis/mismatched_args.d

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module dscanner.analysis.mismatched_args;
22

3+
import dparse.ast;
4+
import dparse.lexer : tok, Token;
35
import dscanner.analysis.base;
46
import dscanner.utils : safeAccess;
7+
import dsymbol.builtin.names;
58
import dsymbol.scope_;
69
import dsymbol.symbol;
7-
import dparse.ast;
8-
import dparse.lexer : tok, Token;
9-
import dsymbol.builtin.names;
1010

1111
/// Checks for mismatched argument and parameter names
1212
final class MismatchedArgumentCheck : BaseAnalyzer
@@ -22,8 +22,6 @@ final class MismatchedArgumentCheck : BaseAnalyzer
2222
override void visit(const FunctionCallExpression fce)
2323
{
2424
import std.typecons : scoped;
25-
import std.algorithm.iteration : each, map;
26-
import std.array : array;
2725

2826
if (fce.arguments is null)
2927
return;
@@ -53,7 +51,7 @@ final class MismatchedArgumentCheck : BaseAnalyzer
5351
{
5452
// The cast is a hack because .array() confuses the compiler's overload
5553
// resolution code.
56-
const(istring)[] params = sym is null ? [] : sym.argNames[].map!(a => cast() a).array();
54+
const(istring)[] params = sym is null ? [] : sym.argNames;
5755
const ArgMismatch[] mismatches = compareArgsToParams(params, args);
5856
if (mismatches.length == 0)
5957
matched = true;
@@ -251,8 +249,8 @@ unittest
251249

252250
unittest
253251
{
252+
import dscanner.analysis.config : Check, disabledConfig, StaticAnalysisConfig;
254253
import dscanner.analysis.helpers : assertAnalyzerWarnings;
255-
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
256254
import std.stdio : stderr;
257255

258256
StaticAnalysisConfig sac = disabledConfig();

src/dscanner/analysis/unused.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module dscanner.analysis.unused;
77
import dparse.ast;
88
import dparse.lexer;
99
import dscanner.analysis.base;
10-
import std.container;
11-
import std.regex : Regex, regex, matchAll;
1210
import dsymbol.scope_ : Scope;
1311
import std.algorithm : all;
12+
import std.container;
13+
import std.regex : matchAll, regex, Regex;
1414

1515
/**
1616
* Checks for unused variables.
@@ -86,10 +86,10 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer
8686

8787
override void visit(const SwitchStatement switchStatement)
8888
{
89-
if (switchStatement.expression !is null)
89+
if (switchStatement.condition !is null && switchStatement.condition.expression !is null)
9090
{
9191
interestDepth++;
92-
switchStatement.expression.accept(this);
92+
switchStatement.condition.expression.accept(this);
9393
interestDepth--;
9494
}
9595
switchStatement.accept(this);

0 commit comments

Comments
 (0)