Access to member variables in member functions
This commit is contained in:
parent
9e92c2863a
commit
f72048383a
|
@ -1772,6 +1772,26 @@ Expression* Parser::ParseSimpleExpression(void)
|
||||||
mScanner->NextToken();
|
mScanner->NextToken();
|
||||||
break;
|
break;
|
||||||
case TK_IDENT:
|
case TK_IDENT:
|
||||||
|
if (mThisPointer)
|
||||||
|
{
|
||||||
|
dec = mThisPointer->mBase->mBase->mScope->Lookup(mScanner->mTokenIdent);
|
||||||
|
if (dec)
|
||||||
|
{
|
||||||
|
Expression * texp = new Expression(mScanner->mLocation, EX_VARIABLE);
|
||||||
|
texp->mDecType = mThisPointer->mBase;
|
||||||
|
texp->mDecValue = mThisPointer;
|
||||||
|
|
||||||
|
Expression* dexp = new Expression(mScanner->mLocation, EX_PREFIX);
|
||||||
|
dexp->mToken = TK_MUL;
|
||||||
|
dexp->mDecType = texp->mDecType->mBase;
|
||||||
|
dexp->mLeft = texp;
|
||||||
|
|
||||||
|
exp = ParseQualify(dexp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exp)
|
||||||
|
{
|
||||||
dec = ParseQualIdent();
|
dec = ParseQualIdent();
|
||||||
if (dec)
|
if (dec)
|
||||||
{
|
{
|
||||||
|
@ -1814,6 +1834,7 @@ Expression* Parser::ParseSimpleExpression(void)
|
||||||
mErrors->Error(mScanner->mLocation, EERR_INVALID_IDENTIFIER, "Invalid identifier", mScanner->mTokenIdent);
|
mErrors->Error(mScanner->mLocation, EERR_INVALID_IDENTIFIER, "Invalid identifier", mScanner->mTokenIdent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case TK_SIZEOF:
|
case TK_SIZEOF:
|
||||||
|
|
Loading…
Reference in New Issue