Skip to content

Commit

Permalink
upgrade libdparse to 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed May 23, 2023
1 parent 93f338a commit 4b2124e
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion DCD
Submodule DCD updated 127 files
4 changes: 2 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"built_with_dub"
],
"dependencies": {
"libdparse": ">=0.21.1 <0.23.0",
"dcd:dsymbol": ">=0.14.0 <0.16.0",
"libdparse": ">=0.23.0 <0.24.0",
"dcd:dsymbol": ">=0.16.0-beta.2 <0.17.0",
"inifiled": "~>1.3.1",
"emsi_containers": "~>0.9.0",
"libddoc": "~>0.8.0"
Expand Down
4 changes: 2 additions & 2 deletions dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"fileVersion": 1,
"versions": {
"dcd": "0.15.2",
"dcd": "0.16.0-beta.2",
"dsymbol": "0.13.0",
"emsi_containers": "0.9.0",
"inifiled": "1.3.3",
"libddoc": "0.8.0",
"libdparse": "0.22.0",
"libdparse": "0.23.0",
"stdx-allocator": "2.77.5"
}
}
4 changes: 2 additions & 2 deletions src/dscanner/analysis/assert_without_msg.d
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ final class AssertWithoutMessageCheck : BaseAnalyzer
.unaryExpression.primaryExpression.identifierOrTemplateInstance)
{
auto ident = iot.identifier;
if (ident.text == "enforce" && expr.arguments !is null && expr.arguments.argumentList !is null &&
expr.arguments.argumentList.items.length < 2)
if (ident.text == "enforce" && expr.arguments !is null && expr.arguments.namedArgumentList !is null &&
expr.arguments.namedArgumentList.items.length < 2)
addErrorMessage(ident.line, ident.column, KEY, MESSAGE);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dscanner/analysis/mismatched_args.d
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ final class IdentVisitor : ASTVisitor

final class ArgVisitor : ASTVisitor
{
override void visit(const ArgumentList al)
override void visit(const NamedArgumentList al)
{
foreach (a; al.items)
{
auto u = cast(UnaryExpression) a;
auto u = cast(UnaryExpression) a.assignExpression;
if (u !is null)
visit(u);
else
Expand Down
4 changes: 2 additions & 2 deletions src/dscanner/analysis/properly_documented_public_functions.d
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ final class ProperlyDocumentedPublicFunctions : BaseAnalyzer
thrown ~= newNamedType(tsa.token);
}
// enforce!(Type)(condition);
else if (const TemplateArgumentList tal = safeAccess(iot.templateInstance)
.templateArguments.templateArgumentList)
else if (const NamedTemplateArgumentList tal = safeAccess(iot.templateInstance)
.templateArguments.namedTemplateArgumentList)
{
if (tal.items.length && tal.items[0].type)
thrown ~= tal.items[0].type;
Expand Down
4 changes: 2 additions & 2 deletions src/dscanner/analysis/range.d
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ final class BackwardsRangeCheck : BaseAnalyzer
if (index.low !is null && index.high !is null)
{
state = State.left;
visit(index.low);
dynamicDispatch(index.low);
state = State.right;
visit(index.high);
dynamicDispatch(index.high);
state = State.ignore;
if (hasLeft && hasRight && left > right)
{
Expand Down
87 changes: 49 additions & 38 deletions src/dscanner/astprinter.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<addExpression operator=\"", str(addExpression.operator), "\">");
output.writeln("<left>");
visit(addExpression.left);
dynamicDispatch(addExpression.left);
output.writeln("</left>");
if (addExpression.right !is null)
{
output.writeln("<right>");
visit(addExpression.right);
dynamicDispatch(addExpression.right);
output.writeln("</right>");
}
output.writeln("</addExpression>");
Expand Down Expand Up @@ -56,12 +56,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<andAndExpression>");
output.writeln("<left>");
visit(andAndExpression.left);
dynamicDispatch(andAndExpression.left);
output.writeln("</left>");
if (andAndExpression.right !is null)
{
output.writeln("<right>");
visit(andAndExpression.right);
dynamicDispatch(andAndExpression.right);
output.writeln("</right>");
}
output.writeln("</andAndExpression>");
Expand All @@ -71,12 +71,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<andExpression>");
output.writeln("<left>");
visit(andExpression.left);
dynamicDispatch(andExpression.left);
output.writeln("</left>");
if (andExpression.right !is null)
{
output.writeln("<right>");
visit(andExpression.right);
dynamicDispatch(andExpression.right);
output.writeln("</right>");
}
output.writeln("</andExpression>");
Expand Down Expand Up @@ -182,13 +182,13 @@ class XMLPrinter : ASTVisitor
if (caseRangeStatement.low !is null)
{
output.writeln("<low>");
visit(caseRangeStatement.low);
dynamicDispatch(caseRangeStatement.low);
output.writeln("</low>");
}
if (caseRangeStatement.high !is null)
{
output.writeln("<high>");
visit(caseRangeStatement.high);
dynamicDispatch(caseRangeStatement.high);
output.writeln("</high>");
}
if (caseRangeStatement.declarationsAndStatements !is null)
Expand Down Expand Up @@ -286,7 +286,7 @@ class XMLPrinter : ASTVisitor
if (deprecated_.assignExpression !is null)
{
output.writeln("<deprecated>");
visit(deprecated_.assignExpression);
dynamicDispatch(deprecated_.assignExpression);
output.writeln("</deprecated>");
}
else
Expand All @@ -311,7 +311,7 @@ class XMLPrinter : ASTVisitor
visit(enumMember.type);
output.write("<name>", enumMember.name.text, "</name>");
if (enumMember.assignExpression !is null)
visit(enumMember.assignExpression);
dynamicDispatch(enumMember.assignExpression);
output.writeln("</anonymousEnumMember>");
}

Expand All @@ -327,10 +327,10 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<equalExpression operator=\"", str(equalExpression.operator), "\">");
output.writeln("<left>");
visit(equalExpression.left);
dynamicDispatch(equalExpression.left);
output.writeln("</left>");
output.writeln("<right>");
visit(equalExpression.right);
dynamicDispatch(equalExpression.right);
output.writeln("</right>");
output.writeln("</equalExpression>");
}
Expand Down Expand Up @@ -447,10 +447,10 @@ class XMLPrinter : ASTVisitor
else
output.writeln("<identityExpression operator=\"is\">");
output.writeln("<left>");
visit(identityExpression.left);
dynamicDispatch(identityExpression.left);
output.writeln("</left>");
output.writeln("<right>");
visit(identityExpression.right);
dynamicDispatch(identityExpression.right);
output.writeln("</right>");
output.writeln("</identityExpression>");
}
Expand Down Expand Up @@ -500,10 +500,10 @@ class XMLPrinter : ASTVisitor
else
output.writeln("<inExpression operator=\"in\">");
output.writeln("<left>");
visit(inExpression.left);
dynamicDispatch(inExpression.left);
output.writeln("</left>");
output.writeln("<right>");
visit(inExpression.right);
dynamicDispatch(inExpression.right);
output.writeln("</right>");
output.writeln("</inExpression>");
}
Expand Down Expand Up @@ -572,10 +572,10 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<keyValuePair>");
output.writeln("<key>");
visit(keyValuePair.key);
dynamicDispatch(keyValuePair.key);
output.writeln("</key>");
output.writeln("<value>");
visit(keyValuePair.value);
dynamicDispatch(keyValuePair.value);
output.writeln("</value>");
output.writeln("</keyValuePair>");
}
Expand Down Expand Up @@ -635,12 +635,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<mulExpression operator=\"", str(mulExpression.operator), "\">");
output.writeln("<left>");
visit(mulExpression.left);
dynamicDispatch(mulExpression.left);
output.writeln("</left>");
if (mulExpression.right !is null)
{
output.writeln("<right>");
visit(mulExpression.right);
dynamicDispatch(mulExpression.right);
output.writeln("</right>");
}
output.writeln("</mulExpression>");
Expand All @@ -650,12 +650,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<orOrExpression>");
output.writeln("<left>");
visit(orOrExpression.left);
dynamicDispatch(orOrExpression.left);
output.writeln("</left>");
if (orOrExpression.right !is null)
{
output.writeln("<right>");
visit(orOrExpression.right);
dynamicDispatch(orOrExpression.right);
output.writeln("</right>");
}
output.writeln("</orOrExpression>");
Expand Down Expand Up @@ -686,12 +686,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<powExpression>");
output.writeln("<left>");
visit(powExpression.left);
dynamicDispatch(powExpression.left);
output.writeln("</left>");
if (powExpression.right !is null)
{
output.writeln("<right>");
visit(powExpression.right);
dynamicDispatch(powExpression.right);
output.writeln("</right>");
}
output.writeln("</powExpression>");
Expand All @@ -702,10 +702,10 @@ class XMLPrinter : ASTVisitor
output.writeln("<relExpression operator=\"",
xmlAttributeEscape(str(relExpression.operator)), "\">");
output.writeln("<left>");
visit(relExpression.left);
dynamicDispatch(relExpression.left);
output.writeln("</left>");
output.writeln("<right>");
visit(relExpression.right);
dynamicDispatch(relExpression.right);
output.writeln("</right>");
output.writeln("</relExpression>");
}
Expand All @@ -727,10 +727,10 @@ class XMLPrinter : ASTVisitor
output.writeln("<shiftExpression operator=\"",
xmlAttributeEscape(str(shiftExpression.operator)), "\">");
output.writeln("<left>");
visit(shiftExpression.left);
dynamicDispatch(shiftExpression.left);
output.writeln("</left>");
output.writeln("<right>");
visit(shiftExpression.right);
dynamicDispatch(shiftExpression.right);
output.writeln("</right>");
output.writeln("</shiftExpression>");
}
Expand Down Expand Up @@ -763,7 +763,7 @@ class XMLPrinter : ASTVisitor
if (templateAliasParameter.colonExpression !is null)
{
output.writeln("<specialization>");
visit(templateAliasParameter.colonExpression);
dynamicDispatch(templateAliasParameter.colonExpression);
output.writeln("</specialization>");
}
else if (templateAliasParameter.colonType !is null)
Expand All @@ -776,7 +776,7 @@ class XMLPrinter : ASTVisitor
if (templateAliasParameter.assignExpression !is null)
{
output.writeln("<default>");
visit(templateAliasParameter.assignExpression);
dynamicDispatch(templateAliasParameter.assignExpression);
output.writeln("</default>");
}
else if (templateAliasParameter.assignType !is null)
Expand Down Expand Up @@ -921,14 +921,14 @@ class XMLPrinter : ASTVisitor
if (typeSuffix.high !is null)
{
output.writeln("<low>");
visit(typeSuffix.low);
dynamicDispatch(typeSuffix.low);
output.writeln("</low>");
output.writeln("<high>");
visit(typeSuffix.high);
dynamicDispatch(typeSuffix.high);
output.writeln("</high>");
}
else
visit(typeSuffix.low);
dynamicDispatch(typeSuffix.low);
output.writeln("</typeSuffix>");
}
}
Expand Down Expand Up @@ -1000,12 +1000,12 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<xorExpression>");
output.writeln("<left>");
visit(xorExpression.left);
dynamicDispatch(xorExpression.left);
output.writeln("</left>");
if (xorExpression.right !is null)
{
output.writeln("<right>");
visit(xorExpression.right);
dynamicDispatch(xorExpression.right);
output.writeln("</right>");
}
output.writeln("</xorExpression>");
Expand All @@ -1017,23 +1017,34 @@ class XMLPrinter : ASTVisitor
if (index.high)
{
output.writeln("<low>");
visit(index.low);
dynamicDispatch(index.low);
output.writeln("</low>");

output.writeln("<high>");
visit(index.high);
dynamicDispatch(index.high);
output.writeln("</high>");
}
else
visit(index.low);
dynamicDispatch(index.low);
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
override void visit(const AliasInitializer aliasInitializer) { mixin (tagAndAccept!"aliasInitializer"); }
override void visit(const AliasThisDeclaration aliasThisDeclaration) { mixin (tagAndAccept!"aliasThisDeclaration"); }
override void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { mixin (tagAndAccept!"anonymousEnumDeclaration"); }
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 ArrayInitializer arrayInitializer) { mixin (tagAndAccept!"arrayInitializer"); }
override void visit(const ArrayLiteral arrayLiteral) { mixin (tagAndAccept!"arrayLiteral"); }
Expand Down

0 comments on commit 4b2124e

Please sign in to comment.