Skip to content

Commit

Permalink
Upgrade to the latest libdparse version.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed May 11, 2018
1 parent 040983f commit c1a32d9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license "MIT"

dependency "vibe-d:web" version=">=0.7.31 <0.9.0"
dependency "hyphenate" version="~>1.1.0"
dependency "libdparse" version="~>0.7.0"
dependency "libdparse" version="~>0.8.0"

configuration "application" {
targetType "executable"
Expand Down
14 changes: 7 additions & 7 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"versions": {
"botan": "1.12.9",
"botan-math": "1.0.3",
"diet-ng": "1.4.4",
"eventcore": "0.8.27",
"diet-ng": "1.4.5",
"eventcore": "0.8.34+commit.4.g745e4ea",
"hyphenate": "1.1.1",
"libasync": "0.8.3",
"libdparse": "0.7.1",
"libdparse": "0.8.4",
"libevent": "2.0.2+2.0.16",
"memutils": "0.4.10",
"openssl": "1.1.6+1.0.1g",
"stdx-allocator": "2.77.0",
"taggedalgebraic": "0.10.9",
"vibe-core": "1.4.0-alpha.1",
"vibe-d": "0.8.3-alpha.4+commit.24.g3759bde"
"stdx-allocator": "2.77.1",
"taggedalgebraic": "0.10.11",
"vibe-core": "1.4.0",
"vibe-d": "0.8.3"
}
}
23 changes: 13 additions & 10 deletions source/ddox/parsers/dparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private struct DParser
ret ~= fdr;
} else if (auto vd = decl.variableDeclaration) {
comment = vd.comment.undecorateComment();
line = vd.declarators[0].name.line;
line = vd.declarators.length ? vd.declarators[0].name.line : vd.autoDeclaration.parts[0].identifier.line;
foreach (d; vd.declarators) {
auto v = new VariableDeclaration(parent, d.name.text.idup);
resolveTypeDeferred(&v.type, vd.type, parent);
Expand Down Expand Up @@ -358,23 +358,26 @@ private struct DParser

Type parseType(in dparse.Type2 type, Entity scope_)
{
import dparse.ast : TypeIdentifierPart;

Type ret;
if (type.builtinType) {
ret.kind = TypeKind.Primitive;
ret.typeName = dlex.str(type.builtinType);
} else if (type.symbol) {
ret.kind = TypeKind.Primitive;
ret.typeName = formatNode(type.symbol);
resolveTypeDecl(ret, scope_);
} else if (auto te = type.typeofExpression) {
ret.kind = TypeKind.Primitive;
ret.typeName = formatNode(te.expression);
// te.return_?
} else if (auto itc = type.identifierOrTemplateChain) {
} else if (auto ti = type.typeIdentifierPart) {
ret.kind = TypeKind.Primitive;
ret.typeName = itc.identifiersOrTemplateInstances
.map!(it => it.templateInstance ? formatNode(it.templateInstance) : it.identifier.text.idup)
.join(".");
for (Rebindable!(const(TypeIdentifierPart)) i = ti; i; i = i.typeIdentifierPart) {
if (i.dot) ret.typeName ~= ".";
auto iot = i.identifierOrTemplateInstance;
if (iot.templateInstance) {
ret.typeName ~= formatNode(iot.templateInstance);
} else {
ret.typeName ~= iot.identifier.text.idup;
}
}
resolveTypeDecl(ret, scope_);
} else if (auto tc = type.typeConstructor) {
ret = parseType(type.type, scope_);
Expand Down

0 comments on commit c1a32d9

Please sign in to comment.