Upgrade libdparse and DCD

This commit is contained in:
WebFreak001 2025-12-26 22:35:02 +01:00 committed by Jan Jurzitza
parent dc907e4a24
commit 9236b97ae9
6 changed files with 15 additions and 17 deletions

2
DCD

@ -1 +1 @@
Subproject commit 1c60c5480f70db568279e4637a5033953c777406
Subproject commit a0441ba8c5c7d841e481413a56a1ebe4f8364811

View File

@ -12,7 +12,7 @@
],
"dependencies": {
"libdparse": ">=0.23.1 <0.26.0",
"dcd:dsymbol": ">=0.16.0-beta.2 <0.17.0",
"dcd:dsymbol": ">=0.16.2 <0.17.0",
"inifiled": "~>1.3.1",
"emsi_containers": "~>0.9.0",
"libddoc": "~>0.8.0"

View File

@ -1,12 +1,12 @@
{
"fileVersion": 1,
"versions": {
"dcd": "0.16.0-beta.2",
"dcd": "0.16.2",
"dsymbol": "0.13.0",
"emsi_containers": "0.9.0",
"inifiled": "1.3.3",
"libddoc": "0.8.0",
"libdparse": "0.25.0",
"libdparse": "0.25.1",
"stdx-allocator": "2.77.5"
}
}

@ -1 +1 @@
Subproject commit f8a6c28589aae180532fb460a1b22e92a0978292
Subproject commit 6b348eb57922fc8fc77d7b6a02c1ab8afd180b8f

View File

@ -1,12 +1,12 @@
module dscanner.analysis.mismatched_args;
import dscanner.analysis.base;
import dscanner.utils : safeAccess;
import dsymbol.scope_;
import dsymbol.symbol;
import dparse.ast;
import dparse.lexer : tok, Token;
import dscanner.analysis.base;
import dscanner.utils : safeAccess;
import dsymbol.builtin.names;
import dsymbol.scope_;
import dsymbol.symbol;
/// Checks for mismatched argument and parameter names
final class MismatchedArgumentCheck : BaseAnalyzer
@ -22,8 +22,6 @@ final class MismatchedArgumentCheck : BaseAnalyzer
override void visit(const FunctionCallExpression fce)
{
import std.typecons : scoped;
import std.algorithm.iteration : each, map;
import std.array : array;
if (fce.arguments is null)
return;
@ -53,7 +51,7 @@ final class MismatchedArgumentCheck : BaseAnalyzer
{
// The cast is a hack because .array() confuses the compiler's overload
// resolution code.
const(istring)[] params = sym is null ? [] : sym.argNames[].map!(a => cast() a).array();
const(istring)[] params = sym is null ? [] : sym.argNames;
const ArgMismatch[] mismatches = compareArgsToParams(params, args);
if (mismatches.length == 0)
matched = true;
@ -251,8 +249,8 @@ unittest
unittest
{
import dscanner.analysis.config : Check, disabledConfig, StaticAnalysisConfig;
import dscanner.analysis.helpers : assertAnalyzerWarnings;
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
import std.stdio : stderr;
StaticAnalysisConfig sac = disabledConfig();

View File

@ -7,10 +7,10 @@ module dscanner.analysis.unused;
import dparse.ast;
import dparse.lexer;
import dscanner.analysis.base;
import std.container;
import std.regex : Regex, regex, matchAll;
import dsymbol.scope_ : Scope;
import std.algorithm : all;
import std.container;
import std.regex : matchAll, regex, Regex;
/**
* Checks for unused variables.
@ -86,10 +86,10 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer
override void visit(const SwitchStatement switchStatement)
{
if (switchStatement.expression !is null)
if (switchStatement.condition !is null && switchStatement.condition.expression !is null)
{
interestDepth++;
switchStatement.expression.accept(this);
switchStatement.condition.expression.accept(this);
interestDepth--;
}
switchStatement.accept(this);