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

Alloc allign attributes, lambda captures

This commit is contained in:
Brian Fiete 2019-11-26 13:11:17 -08:00
parent 79ccb33586
commit 12e5b525ad
23 changed files with 540 additions and 219 deletions

View file

@ -938,7 +938,7 @@ StringView BfAstNode::ToStringView()
return StringView();
}
auto source = GetSourceData();
auto source = GetSourceData();
return StringView(source->mSrc + GetSrcStart(), srcLen);
}
@ -956,6 +956,15 @@ void BfAstNode::ToString(StringImpl& str)
str.Append(source->mSrc + GetSrcStart(), srcLen);
}
bool BfAstNode::Equals(const StringImpl& str)
{
int len = mSrcEnd - mSrcStart;
if (len != str.mLength)
return false;
auto source = GetSourceData();
return strncmp(str.GetPtr(), source->mSrc + mSrcStart, len) == 0;
}
//////////////////////////////////////////////////////////////////////////
void BfBlock::Init(const SizedArrayImpl<BfAstNode*>& vec, BfAstAllocator* alloc)