mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Parse fix with misplaced custom attributes
This commit is contained in:
parent
166ff4d5e3
commit
87f3aa0335
1 changed files with 17 additions and 0 deletions
|
@ -6302,6 +6302,17 @@ BfAstNode* BfReducer::ReadTypeMember(BfTokenNode* tokenNode, bool declStarted, i
|
|||
nextNode = mVisitorPos.GetNext();
|
||||
if (nextNode != NULL)
|
||||
{
|
||||
if (auto nextTokenNode = BfNodeDynCast<BfTokenNode>(nextNode))
|
||||
{
|
||||
if ((nextTokenNode->mToken == BfToken_LBracket) && (depth > 0))
|
||||
{
|
||||
// We can't apply this to a custom attribute
|
||||
AddErrorNode(tokenNode);
|
||||
Fail("Unexpected token", tokenNode);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
mVisitorPos.MoveNext();
|
||||
typeMember = ReadTypeMember(nextNode, true, depth + 1);
|
||||
}
|
||||
|
@ -6800,6 +6811,12 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, bool declStarted, int dept
|
|||
}
|
||||
}
|
||||
|
||||
if ((token == BfToken_LBracket) && (depth > 0))
|
||||
{
|
||||
Fail("Unexpected custom attribute", node);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (isTypeRef)
|
||||
{
|
||||
// Handled below
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue