From 55e8577067de9fcad756ba4bee35f9b1cc898b3b Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Tue, 5 Nov 2013 14:38:37 +0000 Subject: [PATCH] #66 --- astconverter.d | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/astconverter.d b/astconverter.d index a59a306..4015d50 100644 --- a/astconverter.d +++ b/astconverter.d @@ -180,6 +180,37 @@ final class FirstPass : ASTVisitor } } + override void visit(AliasDeclaration aliasDeclaration) + { + if (aliasDeclaration.initializers.length == 0) + { + SemanticSymbol* symbol = new SemanticSymbol( + aliasDeclaration.name.value.dup, + CompletionKind.aliasName, + symbolFile, + aliasDeclaration.name.startIndex); + symbol.type = aliasDeclaration.type; + symbol.protection = protection; + symbol.parent = currentSymbol; + currentSymbol.addChild(symbol); + } + else + { + foreach (initializer; aliasDeclaration.initializers) + { + SemanticSymbol* symbol = new SemanticSymbol( + initializer.name.value.dup, + CompletionKind.aliasName, + symbolFile, + initializer.name.startIndex); + symbol.type = initializer.type; + symbol.protection = protection; + symbol.parent = currentSymbol; + currentSymbol.addChild(symbol); + } + } + } + override void visit(AliasThisDeclaration dec) { // Log.trace(__FUNCTION__, " ", typeof(dec).stringof); @@ -192,8 +223,8 @@ final class FirstPass : ASTVisitor if (dec.attributeDeclaration !is null && isProtection(dec.attributeDeclaration.attribute.attribute)) { - protection = dec.attributeDeclaration.attribute.attribute; - return; + protection = dec.attributeDeclaration.attribute.attribute; + return; } TokenType p = protection; foreach (Attribute attr; dec.attributes) @@ -545,6 +576,7 @@ private: * $(LI base classes) * $(LI mixin templates) * $(LI alias this) + * $(LI alias declarations) * ) */ struct ThirdPass @@ -584,6 +616,9 @@ private: currentSymbol.acSymbol.type = resolveType(currentSymbol.type, currentSymbol.acSymbol.location); break; + case aliasName: + // TODO + break; case enumName: case keyword: case enumMember: @@ -592,7 +627,6 @@ private: case dummy: case array: case assocArray: - case aliasName: case templateName: case mixinTemplateName: break;