mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
HiddenAtom fix for non-static nameless types
This commit is contained in:
parent
ad3c7ce767
commit
d67a6243eb
3 changed files with 15 additions and 6 deletions
|
@ -1555,6 +1555,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
||||||
|
|
||||||
mCurTypeDef->mSystem = mSystem;
|
mCurTypeDef->mSystem = mSystem;
|
||||||
mCurTypeDef->mProject = mCurSource->mProject;
|
mCurTypeDef->mProject = mCurSource->mProject;
|
||||||
|
mCurTypeDef->mIsStatic = typeDeclaration->mStaticSpecifier != NULL;
|
||||||
mCurTypeDef->mNamespace = mNamespace;
|
mCurTypeDef->mNamespace = mNamespace;
|
||||||
mSystem->AddNamespaceUsage(mCurTypeDef->mNamespace, mCurTypeDef->mProject);
|
mSystem->AddNamespaceUsage(mCurTypeDef->mNamespace, mCurTypeDef->mProject);
|
||||||
if ((typeDeclaration->mTypeNode == NULL) && (!isAnonymous))
|
if ((typeDeclaration->mTypeNode == NULL) && (!isAnonymous))
|
||||||
|
@ -1571,10 +1572,15 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
||||||
|
|
||||||
if (mCurTypeDef->mName == NULL)
|
if (mCurTypeDef->mName == NULL)
|
||||||
{
|
{
|
||||||
// Global
|
if (mCurTypeDef->mIsStatic)
|
||||||
mCurTypeDef->mName = mSystem->mGlobalsAtom;
|
{
|
||||||
|
// Global
|
||||||
|
mCurTypeDef->mName = mSystem->mGlobalsAtom;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mCurTypeDef->mName = mSystem->mHiddenAtom;
|
||||||
mCurTypeDef->mName->Ref();
|
mCurTypeDef->mName->Ref();
|
||||||
BF_ASSERT(mCurTypeDef->mSystem != NULL);
|
BF_ASSERT(mCurTypeDef->mSystem != NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1791,8 +1797,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
||||||
mCurTypeDef->mSource = mCurSource;
|
mCurTypeDef->mSource = mCurSource;
|
||||||
mCurTypeDef->mSource->mRefCount++;
|
mCurTypeDef->mSource->mRefCount++;
|
||||||
mCurTypeDef->mTypeDeclaration = typeDeclaration;
|
mCurTypeDef->mTypeDeclaration = typeDeclaration;
|
||||||
mCurTypeDef->mIsAbstract = (typeDeclaration->mAbstractSpecifier != NULL) && (typeDeclaration->mAbstractSpecifier->GetToken() == BfToken_Abstract);
|
mCurTypeDef->mIsAbstract = (typeDeclaration->mAbstractSpecifier != NULL) && (typeDeclaration->mAbstractSpecifier->GetToken() == BfToken_Abstract);
|
||||||
mCurTypeDef->mIsStatic = typeDeclaration->mStaticSpecifier != NULL;
|
|
||||||
mCurTypeDef->mIsDelegate = false;
|
mCurTypeDef->mIsDelegate = false;
|
||||||
mCurTypeDef->mIsFunction = false;
|
mCurTypeDef->mIsFunction = false;
|
||||||
|
|
||||||
|
|
|
@ -2093,6 +2093,7 @@ BfSystem::BfSystem()
|
||||||
mEmptyAtom = GetAtom("");
|
mEmptyAtom = GetAtom("");
|
||||||
mBfAtom = GetAtom("bf");
|
mBfAtom = GetAtom("bf");
|
||||||
mGlobalsAtom = GetAtom("@");
|
mGlobalsAtom = GetAtom("@");
|
||||||
|
mHiddenAtom = GetAtom("?");
|
||||||
mTypeDot = NULL;
|
mTypeDot = NULL;
|
||||||
|
|
||||||
if (gBfParserCache == NULL)
|
if (gBfParserCache == NULL)
|
||||||
|
@ -2159,6 +2160,7 @@ BfSystem::~BfSystem()
|
||||||
delete project;
|
delete project;
|
||||||
|
|
||||||
ReleaseAtom(mGlobalsAtom);
|
ReleaseAtom(mGlobalsAtom);
|
||||||
|
ReleaseAtom(mHiddenAtom);
|
||||||
ReleaseAtom(mBfAtom);
|
ReleaseAtom(mBfAtom);
|
||||||
ReleaseAtom(mEmptyAtom);
|
ReleaseAtom(mEmptyAtom);
|
||||||
ProcessAtomGraveyard();
|
ProcessAtomGraveyard();
|
||||||
|
@ -2729,7 +2731,8 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
|
||||||
partialStartEntryIdx = -1;
|
partialStartEntryIdx = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((typeDef->mFullName == qualifiedFindName) && (CheckTypeDefReference(typeDef, project)))
|
if ((typeDef->mFullName == qualifiedFindName) && (CheckTypeDefReference(typeDef, project)) /*&&
|
||||||
|
((allowGlobal) || (!typeDef->IsGlobalsContainer()))*/)
|
||||||
{
|
{
|
||||||
int curPri = curNamespacePri;
|
int curPri = curNamespacePri;
|
||||||
if (typeDef->mGenericParamDefs.size() != numGenericArgs)
|
if (typeDef->mGenericParamDefs.size() != numGenericArgs)
|
||||||
|
|
|
@ -1818,6 +1818,7 @@ public:
|
||||||
Array<BfCompiler*> mCompilers;
|
Array<BfCompiler*> mCompilers;
|
||||||
|
|
||||||
BfAtom* mGlobalsAtom;
|
BfAtom* mGlobalsAtom;
|
||||||
|
BfAtom* mHiddenAtom;
|
||||||
BfAtom* mEmptyAtom;
|
BfAtom* mEmptyAtom;
|
||||||
BfAtom* mBfAtom;
|
BfAtom* mBfAtom;
|
||||||
CritSect mSystemLock; // long-lived, hold while compiling
|
CritSect mSystemLock; // long-lived, hold while compiling
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue