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->mProject = mCurSource->mProject;
|
||||
mCurTypeDef->mIsStatic = typeDeclaration->mStaticSpecifier != NULL;
|
||||
mCurTypeDef->mNamespace = mNamespace;
|
||||
mSystem->AddNamespaceUsage(mCurTypeDef->mNamespace, mCurTypeDef->mProject);
|
||||
if ((typeDeclaration->mTypeNode == NULL) && (!isAnonymous))
|
||||
|
@ -1571,10 +1572,15 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
|||
|
||||
if (mCurTypeDef->mName == NULL)
|
||||
{
|
||||
// Global
|
||||
mCurTypeDef->mName = mSystem->mGlobalsAtom;
|
||||
if (mCurTypeDef->mIsStatic)
|
||||
{
|
||||
// Global
|
||||
mCurTypeDef->mName = mSystem->mGlobalsAtom;
|
||||
}
|
||||
else
|
||||
mCurTypeDef->mName = mSystem->mHiddenAtom;
|
||||
mCurTypeDef->mName->Ref();
|
||||
BF_ASSERT(mCurTypeDef->mSystem != NULL);
|
||||
BF_ASSERT(mCurTypeDef->mSystem != NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1791,8 +1797,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
|||
mCurTypeDef->mSource = mCurSource;
|
||||
mCurTypeDef->mSource->mRefCount++;
|
||||
mCurTypeDef->mTypeDeclaration = typeDeclaration;
|
||||
mCurTypeDef->mIsAbstract = (typeDeclaration->mAbstractSpecifier != NULL) && (typeDeclaration->mAbstractSpecifier->GetToken() == BfToken_Abstract);
|
||||
mCurTypeDef->mIsStatic = typeDeclaration->mStaticSpecifier != NULL;
|
||||
mCurTypeDef->mIsAbstract = (typeDeclaration->mAbstractSpecifier != NULL) && (typeDeclaration->mAbstractSpecifier->GetToken() == BfToken_Abstract);
|
||||
mCurTypeDef->mIsDelegate = false;
|
||||
mCurTypeDef->mIsFunction = false;
|
||||
|
||||
|
|
|
@ -2093,6 +2093,7 @@ BfSystem::BfSystem()
|
|||
mEmptyAtom = GetAtom("");
|
||||
mBfAtom = GetAtom("bf");
|
||||
mGlobalsAtom = GetAtom("@");
|
||||
mHiddenAtom = GetAtom("?");
|
||||
mTypeDot = NULL;
|
||||
|
||||
if (gBfParserCache == NULL)
|
||||
|
@ -2159,6 +2160,7 @@ BfSystem::~BfSystem()
|
|||
delete project;
|
||||
|
||||
ReleaseAtom(mGlobalsAtom);
|
||||
ReleaseAtom(mHiddenAtom);
|
||||
ReleaseAtom(mBfAtom);
|
||||
ReleaseAtom(mEmptyAtom);
|
||||
ProcessAtomGraveyard();
|
||||
|
@ -2729,7 +2731,8 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
|
|||
partialStartEntryIdx = -1;
|
||||
}
|
||||
|
||||
if ((typeDef->mFullName == qualifiedFindName) && (CheckTypeDefReference(typeDef, project)))
|
||||
if ((typeDef->mFullName == qualifiedFindName) && (CheckTypeDefReference(typeDef, project)) /*&&
|
||||
((allowGlobal) || (!typeDef->IsGlobalsContainer()))*/)
|
||||
{
|
||||
int curPri = curNamespacePri;
|
||||
if (typeDef->mGenericParamDefs.size() != numGenericArgs)
|
||||
|
|
|
@ -1818,6 +1818,7 @@ public:
|
|||
Array<BfCompiler*> mCompilers;
|
||||
|
||||
BfAtom* mGlobalsAtom;
|
||||
BfAtom* mHiddenAtom;
|
||||
BfAtom* mEmptyAtom;
|
||||
BfAtom* mBfAtom;
|
||||
CritSect mSystemLock; // long-lived, hold while compiling
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue