upgrade libdparse to 0.23.0

This commit is contained in:
WebFreak001 2023-05-09 05:02:01 +02:00 committed by Jan Jurzitza
parent 93f338a5e7
commit 4b2124e82d
9 changed files with 63 additions and 52 deletions

2
DCD

@ -1 +1 @@
Subproject commit 4946d49abdc35810254151923bab30fb3cc2c004 Subproject commit 1c60c5480f70db568279e4637a5033953c777406

View File

@ -11,8 +11,8 @@
"built_with_dub" "built_with_dub"
], ],
"dependencies": { "dependencies": {
"libdparse": ">=0.21.1 <0.23.0", "libdparse": ">=0.23.0 <0.24.0",
"dcd:dsymbol": ">=0.14.0 <0.16.0", "dcd:dsymbol": ">=0.16.0-beta.2 <0.17.0",
"inifiled": "~>1.3.1", "inifiled": "~>1.3.1",
"emsi_containers": "~>0.9.0", "emsi_containers": "~>0.9.0",
"libddoc": "~>0.8.0" "libddoc": "~>0.8.0"

View File

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

@ -1 +1 @@
Subproject commit 98bf0f4166578717e0b78472ff5054d6f918e797 Subproject commit 86c9bf44c96e1666eb175c749cc26f62c2008979

View File

@ -53,8 +53,8 @@ final class AssertWithoutMessageCheck : BaseAnalyzer
.unaryExpression.primaryExpression.identifierOrTemplateInstance) .unaryExpression.primaryExpression.identifierOrTemplateInstance)
{ {
auto ident = iot.identifier; auto ident = iot.identifier;
if (ident.text == "enforce" && expr.arguments !is null && expr.arguments.argumentList !is null && if (ident.text == "enforce" && expr.arguments !is null && expr.arguments.namedArgumentList !is null &&
expr.arguments.argumentList.items.length < 2) expr.arguments.namedArgumentList.items.length < 2)
addErrorMessage(ident.line, ident.column, KEY, MESSAGE); addErrorMessage(ident.line, ident.column, KEY, MESSAGE);
} }
} }

View File

@ -109,11 +109,11 @@ final class IdentVisitor : ASTVisitor
final class ArgVisitor : ASTVisitor final class ArgVisitor : ASTVisitor
{ {
override void visit(const ArgumentList al) override void visit(const NamedArgumentList al)
{ {
foreach (a; al.items) foreach (a; al.items)
{ {
auto u = cast(UnaryExpression) a; auto u = cast(UnaryExpression) a.assignExpression;
if (u !is null) if (u !is null)
visit(u); visit(u);
else else

View File

@ -91,8 +91,8 @@ final class ProperlyDocumentedPublicFunctions : BaseAnalyzer
thrown ~= newNamedType(tsa.token); thrown ~= newNamedType(tsa.token);
} }
// enforce!(Type)(condition); // enforce!(Type)(condition);
else if (const TemplateArgumentList tal = safeAccess(iot.templateInstance) else if (const NamedTemplateArgumentList tal = safeAccess(iot.templateInstance)
.templateArguments.templateArgumentList) .templateArguments.namedTemplateArgumentList)
{ {
if (tal.items.length && tal.items[0].type) if (tal.items.length && tal.items[0].type)
thrown ~= tal.items[0].type; thrown ~= tal.items[0].type;

View File

@ -106,9 +106,9 @@ final class BackwardsRangeCheck : BaseAnalyzer
if (index.low !is null && index.high !is null) if (index.low !is null && index.high !is null)
{ {
state = State.left; state = State.left;
visit(index.low); dynamicDispatch(index.low);
state = State.right; state = State.right;
visit(index.high); dynamicDispatch(index.high);
state = State.ignore; state = State.ignore;
if (hasLeft && hasRight && left > right) if (hasLeft && hasRight && left > right)
{ {

View File

@ -21,12 +21,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<addExpression operator=\"", str(addExpression.operator), "\">"); output.writeln("<addExpression operator=\"", str(addExpression.operator), "\">");
output.writeln("<left>"); output.writeln("<left>");
visit(addExpression.left); dynamicDispatch(addExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (addExpression.right !is null) if (addExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(addExpression.right); dynamicDispatch(addExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</addExpression>"); output.writeln("</addExpression>");
@ -56,12 +56,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<andAndExpression>"); output.writeln("<andAndExpression>");
output.writeln("<left>"); output.writeln("<left>");
visit(andAndExpression.left); dynamicDispatch(andAndExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (andAndExpression.right !is null) if (andAndExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(andAndExpression.right); dynamicDispatch(andAndExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</andAndExpression>"); output.writeln("</andAndExpression>");
@ -71,12 +71,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<andExpression>"); output.writeln("<andExpression>");
output.writeln("<left>"); output.writeln("<left>");
visit(andExpression.left); dynamicDispatch(andExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (andExpression.right !is null) if (andExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(andExpression.right); dynamicDispatch(andExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</andExpression>"); output.writeln("</andExpression>");
@ -182,13 +182,13 @@ class XMLPrinter : ASTVisitor
if (caseRangeStatement.low !is null) if (caseRangeStatement.low !is null)
{ {
output.writeln("<low>"); output.writeln("<low>");
visit(caseRangeStatement.low); dynamicDispatch(caseRangeStatement.low);
output.writeln("</low>"); output.writeln("</low>");
} }
if (caseRangeStatement.high !is null) if (caseRangeStatement.high !is null)
{ {
output.writeln("<high>"); output.writeln("<high>");
visit(caseRangeStatement.high); dynamicDispatch(caseRangeStatement.high);
output.writeln("</high>"); output.writeln("</high>");
} }
if (caseRangeStatement.declarationsAndStatements !is null) if (caseRangeStatement.declarationsAndStatements !is null)
@ -286,7 +286,7 @@ class XMLPrinter : ASTVisitor
if (deprecated_.assignExpression !is null) if (deprecated_.assignExpression !is null)
{ {
output.writeln("<deprecated>"); output.writeln("<deprecated>");
visit(deprecated_.assignExpression); dynamicDispatch(deprecated_.assignExpression);
output.writeln("</deprecated>"); output.writeln("</deprecated>");
} }
else else
@ -311,7 +311,7 @@ class XMLPrinter : ASTVisitor
visit(enumMember.type); visit(enumMember.type);
output.write("<name>", enumMember.name.text, "</name>"); output.write("<name>", enumMember.name.text, "</name>");
if (enumMember.assignExpression !is null) if (enumMember.assignExpression !is null)
visit(enumMember.assignExpression); dynamicDispatch(enumMember.assignExpression);
output.writeln("</anonymousEnumMember>"); output.writeln("</anonymousEnumMember>");
} }
@ -327,10 +327,10 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<equalExpression operator=\"", str(equalExpression.operator), "\">"); output.writeln("<equalExpression operator=\"", str(equalExpression.operator), "\">");
output.writeln("<left>"); output.writeln("<left>");
visit(equalExpression.left); dynamicDispatch(equalExpression.left);
output.writeln("</left>"); output.writeln("</left>");
output.writeln("<right>"); output.writeln("<right>");
visit(equalExpression.right); dynamicDispatch(equalExpression.right);
output.writeln("</right>"); output.writeln("</right>");
output.writeln("</equalExpression>"); output.writeln("</equalExpression>");
} }
@ -447,10 +447,10 @@ class XMLPrinter : ASTVisitor
else else
output.writeln("<identityExpression operator=\"is\">"); output.writeln("<identityExpression operator=\"is\">");
output.writeln("<left>"); output.writeln("<left>");
visit(identityExpression.left); dynamicDispatch(identityExpression.left);
output.writeln("</left>"); output.writeln("</left>");
output.writeln("<right>"); output.writeln("<right>");
visit(identityExpression.right); dynamicDispatch(identityExpression.right);
output.writeln("</right>"); output.writeln("</right>");
output.writeln("</identityExpression>"); output.writeln("</identityExpression>");
} }
@ -500,10 +500,10 @@ class XMLPrinter : ASTVisitor
else else
output.writeln("<inExpression operator=\"in\">"); output.writeln("<inExpression operator=\"in\">");
output.writeln("<left>"); output.writeln("<left>");
visit(inExpression.left); dynamicDispatch(inExpression.left);
output.writeln("</left>"); output.writeln("</left>");
output.writeln("<right>"); output.writeln("<right>");
visit(inExpression.right); dynamicDispatch(inExpression.right);
output.writeln("</right>"); output.writeln("</right>");
output.writeln("</inExpression>"); output.writeln("</inExpression>");
} }
@ -572,10 +572,10 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<keyValuePair>"); output.writeln("<keyValuePair>");
output.writeln("<key>"); output.writeln("<key>");
visit(keyValuePair.key); dynamicDispatch(keyValuePair.key);
output.writeln("</key>"); output.writeln("</key>");
output.writeln("<value>"); output.writeln("<value>");
visit(keyValuePair.value); dynamicDispatch(keyValuePair.value);
output.writeln("</value>"); output.writeln("</value>");
output.writeln("</keyValuePair>"); output.writeln("</keyValuePair>");
} }
@ -635,12 +635,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<mulExpression operator=\"", str(mulExpression.operator), "\">"); output.writeln("<mulExpression operator=\"", str(mulExpression.operator), "\">");
output.writeln("<left>"); output.writeln("<left>");
visit(mulExpression.left); dynamicDispatch(mulExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (mulExpression.right !is null) if (mulExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(mulExpression.right); dynamicDispatch(mulExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</mulExpression>"); output.writeln("</mulExpression>");
@ -650,12 +650,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<orOrExpression>"); output.writeln("<orOrExpression>");
output.writeln("<left>"); output.writeln("<left>");
visit(orOrExpression.left); dynamicDispatch(orOrExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (orOrExpression.right !is null) if (orOrExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(orOrExpression.right); dynamicDispatch(orOrExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</orOrExpression>"); output.writeln("</orOrExpression>");
@ -686,12 +686,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<powExpression>"); output.writeln("<powExpression>");
output.writeln("<left>"); output.writeln("<left>");
visit(powExpression.left); dynamicDispatch(powExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (powExpression.right !is null) if (powExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(powExpression.right); dynamicDispatch(powExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</powExpression>"); output.writeln("</powExpression>");
@ -702,10 +702,10 @@ class XMLPrinter : ASTVisitor
output.writeln("<relExpression operator=\"", output.writeln("<relExpression operator=\"",
xmlAttributeEscape(str(relExpression.operator)), "\">"); xmlAttributeEscape(str(relExpression.operator)), "\">");
output.writeln("<left>"); output.writeln("<left>");
visit(relExpression.left); dynamicDispatch(relExpression.left);
output.writeln("</left>"); output.writeln("</left>");
output.writeln("<right>"); output.writeln("<right>");
visit(relExpression.right); dynamicDispatch(relExpression.right);
output.writeln("</right>"); output.writeln("</right>");
output.writeln("</relExpression>"); output.writeln("</relExpression>");
} }
@ -727,10 +727,10 @@ class XMLPrinter : ASTVisitor
output.writeln("<shiftExpression operator=\"", output.writeln("<shiftExpression operator=\"",
xmlAttributeEscape(str(shiftExpression.operator)), "\">"); xmlAttributeEscape(str(shiftExpression.operator)), "\">");
output.writeln("<left>"); output.writeln("<left>");
visit(shiftExpression.left); dynamicDispatch(shiftExpression.left);
output.writeln("</left>"); output.writeln("</left>");
output.writeln("<right>"); output.writeln("<right>");
visit(shiftExpression.right); dynamicDispatch(shiftExpression.right);
output.writeln("</right>"); output.writeln("</right>");
output.writeln("</shiftExpression>"); output.writeln("</shiftExpression>");
} }
@ -763,7 +763,7 @@ class XMLPrinter : ASTVisitor
if (templateAliasParameter.colonExpression !is null) if (templateAliasParameter.colonExpression !is null)
{ {
output.writeln("<specialization>"); output.writeln("<specialization>");
visit(templateAliasParameter.colonExpression); dynamicDispatch(templateAliasParameter.colonExpression);
output.writeln("</specialization>"); output.writeln("</specialization>");
} }
else if (templateAliasParameter.colonType !is null) else if (templateAliasParameter.colonType !is null)
@ -776,7 +776,7 @@ class XMLPrinter : ASTVisitor
if (templateAliasParameter.assignExpression !is null) if (templateAliasParameter.assignExpression !is null)
{ {
output.writeln("<default>"); output.writeln("<default>");
visit(templateAliasParameter.assignExpression); dynamicDispatch(templateAliasParameter.assignExpression);
output.writeln("</default>"); output.writeln("</default>");
} }
else if (templateAliasParameter.assignType !is null) else if (templateAliasParameter.assignType !is null)
@ -921,14 +921,14 @@ class XMLPrinter : ASTVisitor
if (typeSuffix.high !is null) if (typeSuffix.high !is null)
{ {
output.writeln("<low>"); output.writeln("<low>");
visit(typeSuffix.low); dynamicDispatch(typeSuffix.low);
output.writeln("</low>"); output.writeln("</low>");
output.writeln("<high>"); output.writeln("<high>");
visit(typeSuffix.high); dynamicDispatch(typeSuffix.high);
output.writeln("</high>"); output.writeln("</high>");
} }
else else
visit(typeSuffix.low); dynamicDispatch(typeSuffix.low);
output.writeln("</typeSuffix>"); output.writeln("</typeSuffix>");
} }
} }
@ -1000,12 +1000,12 @@ class XMLPrinter : ASTVisitor
{ {
output.writeln("<xorExpression>"); output.writeln("<xorExpression>");
output.writeln("<left>"); output.writeln("<left>");
visit(xorExpression.left); dynamicDispatch(xorExpression.left);
output.writeln("</left>"); output.writeln("</left>");
if (xorExpression.right !is null) if (xorExpression.right !is null)
{ {
output.writeln("<right>"); output.writeln("<right>");
visit(xorExpression.right); dynamicDispatch(xorExpression.right);
output.writeln("</right>"); output.writeln("</right>");
} }
output.writeln("</xorExpression>"); output.writeln("</xorExpression>");
@ -1017,23 +1017,34 @@ class XMLPrinter : ASTVisitor
if (index.high) if (index.high)
{ {
output.writeln("<low>"); output.writeln("<low>");
visit(index.low); dynamicDispatch(index.low);
output.writeln("</low>"); output.writeln("</low>");
output.writeln("<high>"); output.writeln("<high>");
visit(index.high); dynamicDispatch(index.high);
output.writeln("</high>"); output.writeln("</high>");
} }
else else
visit(index.low); dynamicDispatch(index.low);
output.writeln("</index>"); output.writeln("</index>");
} }
override void visit(const NamedArgument arg)
{
if (arg.name.text.length)
output.writeln("<argument named=\"", arg.name.text, "\">");
else
output.writeln("<argument>");
dynamicDispatch(arg.assignExpression);
output.writeln("</argument>");
}
// dfmt off // dfmt off
override void visit(const AliasInitializer aliasInitializer) { mixin (tagAndAccept!"aliasInitializer"); } override void visit(const AliasInitializer aliasInitializer) { mixin (tagAndAccept!"aliasInitializer"); }
override void visit(const AliasThisDeclaration aliasThisDeclaration) { mixin (tagAndAccept!"aliasThisDeclaration"); } override void visit(const AliasThisDeclaration aliasThisDeclaration) { mixin (tagAndAccept!"aliasThisDeclaration"); }
override void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { mixin (tagAndAccept!"anonymousEnumDeclaration"); } override void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { mixin (tagAndAccept!"anonymousEnumDeclaration"); }
override void visit(const ArgumentList argumentList) { mixin (tagAndAccept!"argumentList"); } override void visit(const ArgumentList argumentList) { mixin (tagAndAccept!"argumentList"); }
override void visit(const NamedArgumentList argumentList) { mixin (tagAndAccept!"argumentList"); }
override void visit(const Arguments arguments) { mixin (tagAndAccept!"arguments"); } override void visit(const Arguments arguments) { mixin (tagAndAccept!"arguments"); }
override void visit(const ArrayInitializer arrayInitializer) { mixin (tagAndAccept!"arrayInitializer"); } override void visit(const ArrayInitializer arrayInitializer) { mixin (tagAndAccept!"arrayInitializer"); }
override void visit(const ArrayLiteral arrayLiteral) { mixin (tagAndAccept!"arrayLiteral"); } override void visit(const ArrayLiteral arrayLiteral) { mixin (tagAndAccept!"arrayLiteral"); }