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.startLocation = structBody.startLocation;
s.endLocation = structBody.endLocation; s.endLocation = structBody.endLocation;
// Log.trace("Added scope ", s.startLocation, " ", s.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; s.parent = currentScope;
currentScope = s; currentScope = s;
foreach (dec; structBody.declarations) foreach (dec; structBody.declarations)
@ -549,7 +556,7 @@ private:
struct ThirdPass struct ThirdPass
{ {
public: public:
this(SemanticSymbol* rootSymbol, Scope* moduleScope) this(SemanticSymbol* rootSymbol, Scope* moduleScope) pure
{ {
this.rootSymbol = rootSymbol; this.rootSymbol = rootSymbol;
this.moduleScope = moduleScope; this.moduleScope = moduleScope;
@ -668,7 +675,7 @@ private:
return s; return s;
} }
static string[] expandSymbol(const IdentifierOrTemplateChain chain) static string[] expandSymbol(const IdentifierOrTemplateChain chain) pure
{ {
string[] strings = new string[chain.identifiersOrTemplateInstances.length]; string[] strings = new string[chain.identifiersOrTemplateInstances.length];
for (size_t i = 0; i != chain.identifiersOrTemplateInstances.length; ++i) for (size_t i = 0; i != chain.identifiersOrTemplateInstances.length; ++i)