Update libdparse to v0.10.x

This commit is contained in:
Laurent Tréguier 2018-11-09 11:44:30 +01:00
parent fd1f2f5161
commit 7b8211b282
No known key found for this signature in database
GPG Key ID: 09530BFFC32D4A69
3 changed files with 20 additions and 12 deletions

View File

@ -4,7 +4,7 @@
"targetType": "autodetect",
"license": "BSL-1.0",
"dependencies": {
"libdparse": "~>0.9.10"
"libdparse": "~>0.10.7"
},
"targetPath" : "bin/",
"targetName" : "dfmt",

@ -1 +1 @@
Subproject commit f8460d0d3581bebd41ee8629bd3e253c94c8a387
Subproject commit 15c8d2ef166b633825e971eb914d4d78eb33b3ac

View File

@ -214,9 +214,9 @@ final class FormatVisitor : ASTVisitor
override void visit(const FunctionLiteralExpression funcLit)
{
if (funcLit.functionBody !is null)
if (funcLit.specifiedFunctionBody !is null)
{
const bs = funcLit.functionBody.blockStatement;
const bs = funcLit.specifiedFunctionBody.blockStatement;
astInformation.funLitStartLocations ~= bs.startLocation;
astInformation.funLitEndLocations ~= bs.endLocation;
@ -244,15 +244,11 @@ final class FormatVisitor : ASTVisitor
caseRangeStatement.accept(this);
}
override void visit(const FunctionBody functionBody)
override void visit(const SpecifiedFunctionBody specifiedFunctionBody)
{
if (functionBody.blockStatement !is null)
astInformation.doubleNewlineLocations ~= functionBody.blockStatement.endLocation;
if (functionBody.bodyStatement !is null && functionBody.bodyStatement
.blockStatement !is null)
astInformation.doubleNewlineLocations
~= functionBody.bodyStatement.blockStatement.endLocation;
functionBody.accept(this);
if (specifiedFunctionBody.blockStatement !is null)
astInformation.doubleNewlineLocations ~= specifiedFunctionBody.blockStatement.endLocation;
specifiedFunctionBody.accept(this);
}
override void visit(const StructInitializer structInitializer)
@ -367,12 +363,24 @@ final class FormatVisitor : ASTVisitor
storageClass.accept(this);
}
override void visit(const InContractExpression inContractExpression)
{
astInformation.contractLocations ~= inContractExpression.inTokenLocation;
inContractExpression.accept(this);
}
override void visit(const InStatement inStatement)
{
astInformation.contractLocations ~= inStatement.inTokenLocation;
inStatement.accept(this);
}
override void visit(const OutContractExpression outContractExpression)
{
astInformation.contractLocations ~= outContractExpression.outTokenLocation;
outContractExpression.accept(this);
}
override void visit(const OutStatement outStatement)
{
astInformation.contractLocations ~= outStatement.outTokenLocation;