mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
offsetof
This commit is contained in:
parent
507fb82e4a
commit
4cda126188
11 changed files with 156 additions and 10 deletions
|
@ -1871,6 +1871,26 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
|
|||
MEMBER_SET_CHECKED(typeAttrExpr, mCloseParen, tokenNode);
|
||||
exprLeft = typeAttrExpr;
|
||||
}
|
||||
else if (token == BfToken_OffsetOf)
|
||||
{
|
||||
BfOffsetOfExpression* typeAttrExpr = mAlloc->Alloc<BfOffsetOfExpression>();
|
||||
ReplaceNode(tokenNode, typeAttrExpr);
|
||||
typeAttrExpr->mToken = tokenNode;
|
||||
tokenNode = ExpectTokenAfter(typeAttrExpr, BfToken_LParen);
|
||||
MEMBER_SET_CHECKED(typeAttrExpr, mOpenParen, tokenNode);
|
||||
auto typeRef = CreateTypeRefAfter(typeAttrExpr);
|
||||
MEMBER_SET_CHECKED(typeAttrExpr, mTypeRef, typeRef);
|
||||
|
||||
tokenNode = ExpectTokenAfter(typeAttrExpr, BfToken_Comma);
|
||||
MEMBER_SET_CHECKED(typeAttrExpr, mCommaToken, tokenNode);
|
||||
|
||||
auto nameNode = ExpectIdentifierAfter(typeAttrExpr);
|
||||
MEMBER_SET_CHECKED(typeAttrExpr, mMemberName, nameNode);
|
||||
|
||||
tokenNode = ExpectTokenAfter(typeAttrExpr, BfToken_RParen);
|
||||
MEMBER_SET_CHECKED(typeAttrExpr, mCloseParen, tokenNode);
|
||||
exprLeft = typeAttrExpr;
|
||||
}
|
||||
else if (token == BfToken_Default)
|
||||
{
|
||||
auto defaultExpr = mAlloc->Alloc<BfDefaultExpression>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue