MCPcopy Create free account
hub / github.com/beefytech/Beef / ParseAtomComposite

Method ParseAtomComposite

IDEHelper/Compiler/BfSystem.cpp:2289–2318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2287}
2288
2289bool BfSystem::ParseAtomComposite(const StringView& name, BfAtomComposite& composite, bool addRefs)
2290{
2291 if (name.mLength == 0)
2292 return true;
2293
2294 bool isValid = true;
2295
2296 SizedArray<BfAtom*, 6> parts;
2297
2298 BF_ASSERT(composite.mSize == 0);
2299 int lastDot = -1;
2300 for (int i = 0; i <= (int)name.mLength; i++)
2301 {
2302 if ((i == (int)name.mLength) || (name[i] == '.'))
2303 {
2304 BfAtom* atom;
2305 if (addRefs)
2306 atom = GetAtom(String(name.mPtr + lastDot + 1, i - lastDot - 1));
2307 else
2308 atom = FindAtom(StringView(name.mPtr + lastDot + 1, i - lastDot - 1));
2309 if (atom == NULL)
2310 isValid = false;
2311 parts.push_back(atom);
2312 lastDot = i;
2313 }
2314 }
2315 if (!parts.IsEmpty())
2316 composite.Set(&parts[0], (int)parts.size(), NULL, 0);
2317 return isValid;
2318}
2319
2320void BfSystem::RefAtomComposite(const BfAtomComposite& atomComposite)
2321{

Callers 15

CheckMemberReferenceMethod · 0.80
FixitCheckNamespaceMethod · 0.80
UpdateRevisedTypesMethod · 0.80
ResolveTypeResultMethod · 0.80
FindTypeDefMethod · 0.80
TypeRefNotFoundMethod · 0.80
ValidateTypeWildcardMethod · 0.80
ResolveTypeRef_RefMethod · 0.80
UpdateRevisedTypesMethod · 0.80
GetSymbolReferencesMethod · 0.80

Calls 6

StringClass · 0.85
StringViewClass · 0.85
push_backMethod · 0.45
IsEmptyMethod · 0.45
SetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected