1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

File-scoped namespaces

This commit is contained in:
Brian Fiete 2022-04-17 08:40:25 -07:00
parent 2d808ec649
commit f3f2f4c6ec
8 changed files with 76 additions and 18 deletions

View file

@ -11,6 +11,18 @@ class BfResolvePassData;
class BfDefBuilder : public BfStructuralVisitor
{
public:
struct NamespaceState
{
BfAtomComposite mNamespace;
int mNamespaceSearchCount;
NamespaceState()
{
mNamespaceSearchCount = -1;
}
};
public:
BfSource* mCurSource;
BfSystem* mSystem;
@ -27,6 +39,9 @@ public:
Array<BfTypeReference*> mInternalAccessSet;
HashContext* mFullHashCtx;
HashContext* mSignatureHashCtx;
Array<NamespaceState> mFileLevelNamespaceState;
int mNamespaceBlockDepth;
public:
void ParseGenericParams(BfGenericParamsDeclaration* genericParamsDecl, BfGenericConstraintsDeclaration* genericConstraints, Array<BfGenericParamDef*>& genericParams, Array<BfExternalConstraintDef>* externConstraintDefs, int outerGenericSize, bool isInGeneric);
@ -45,6 +60,7 @@ public:
void ParseAttributes(BfAttributeDirective* attributes, BfTypeDef* typeDef);
BfMethodDef* CreateMethodDef(BfMethodDeclaration* methodDecl, BfMethodDef* outerMethodDef = NULL);
BfError* Fail(const StringImpl& errorStr, BfAstNode* refNode);
void SetNamespaceState(const NamespaceState& namespaceState);
public:
BfDefBuilder(BfSystem* bfSystem);