Fixed issue with 'this' not being present in struct bodies

This commit is contained in:
Hackerpilot 2013-10-14 00:50:27 +00:00
parent cc49cef4c7
commit f97add145d
1 changed files with 14 additions and 7 deletions

View File

@ -261,6 +261,13 @@ final class FirstPass : ASTVisitor
s.startLocation = structBody.startLocation;
s.endLocation = structBody.endLocation;
// Log.trace("Added scope ", s.startLocation, " ", s.endLocation);
ACSymbol* thisSymbol = new ACSymbol("this", CompletionKind.variableName,
currentSymbol.acSymbol);
thisSymbol.location = s.startLocation;
thisSymbol.symbolFile = symbolFile;
currentSymbol.acSymbol.parts ~= thisSymbol;
s.parent = currentScope;
currentScope = s;
foreach (dec; structBody.declarations)
@ -549,7 +556,7 @@ private:
struct ThirdPass
{
public:
this(SemanticSymbol* rootSymbol, Scope* moduleScope)
this(SemanticSymbol* rootSymbol, Scope* moduleScope) pure
{
this.rootSymbol = rootSymbol;
this.moduleScope = moduleScope;
@ -668,7 +675,7 @@ private:
return s;
}
static string[] expandSymbol(const IdentifierOrTemplateChain chain)
static string[] expandSymbol(const IdentifierOrTemplateChain chain) pure
{
string[] strings = new string[chain.identifiersOrTemplateInstances.length];
for (size_t i = 0; i != chain.identifiersOrTemplateInstances.length; ++i)