Update libdparse
This commit is contained in:
parent
b03e9de8fa
commit
b73e8c4fca
2
dub.json
2
dub.json
|
@ -8,7 +8,7 @@
|
||||||
"preBuildCommands": ["git log -1 --format='%H' > githash.txt"],
|
"preBuildCommands": ["git log -1 --format='%H' > githash.txt"],
|
||||||
"stringImportPaths": ["."],
|
"stringImportPaths": ["."],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libdparse": "~>0.2.0",
|
"libdparse": "0.2.1",
|
||||||
"inifiled": ">=0.0.3",
|
"inifiled": ">=0.0.3",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 4c46428bf48abffbd647cd1e16f96ba1805187e2
|
Subproject commit 32f6d638e38888e1bb11cf43e93fe2d11132a98f
|
|
@ -8,6 +8,7 @@ module analysis.enumarrayliteral;
|
||||||
import std.d.ast;
|
import std.d.ast;
|
||||||
import std.d.lexer;
|
import std.d.lexer;
|
||||||
import analysis.base;
|
import analysis.base;
|
||||||
|
import std.algorithm : canFind;
|
||||||
|
|
||||||
void doNothing(string, size_t, size_t, string, bool) {}
|
void doNothing(string, size_t, size_t, string, bool) {}
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ class EnumArrayLiteralCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const AutoDeclaration autoDec)
|
override void visit(const AutoDeclaration autoDec)
|
||||||
{
|
{
|
||||||
if (autoDec.storageClass && autoDec.storageClass.token == tok!"enum")
|
if (autoDec.storageClasses.canFind!(a => a.token == tok!"enum"))
|
||||||
{
|
{
|
||||||
foreach (i, initializer; autoDec.initializers)
|
foreach (i, initializer; autoDec.initializers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,11 +66,11 @@ class UnmodifiedFinder:BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const AutoDeclaration autoDeclaration)
|
override void visit(const AutoDeclaration autoDeclaration)
|
||||||
{
|
{
|
||||||
|
import std.algorithm : canFind;
|
||||||
|
|
||||||
if (blockStatementDepth > 0 && isImmutable <= 0
|
if (blockStatementDepth > 0 && isImmutable <= 0
|
||||||
&& (autoDeclaration.storageClass !is null
|
&& (!autoDeclaration.storageClasses.canFind!(a => a.token == tok!"const"
|
||||||
&& autoDeclaration.storageClass.token != tok!"const"
|
|| a.token == tok!"enum" || a.token == tok!"immutable")))
|
||||||
&& autoDeclaration.storageClass.token != tok!"enum"
|
|
||||||
&& autoDeclaration.storageClass.token != tok!"immutable"))
|
|
||||||
{
|
{
|
||||||
foreach (size_t i, id; autoDeclaration.identifiers)
|
foreach (size_t i, id; autoDeclaration.identifiers)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue