mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Document formatted
This commit is contained in:
parent
19e53801f1
commit
118f819cc3
1 changed files with 186 additions and 186 deletions
|
@ -199,7 +199,7 @@ BfAstNode* BfReducer::Fail(const StringImpl& errorMsg, BfAstNode* refNode)
|
|||
if (mPassInstance->HasLastFailedAt(refNode)) // No duplicate failures
|
||||
return NULL;
|
||||
auto error = mPassInstance->Fail(errorMsg, refNode);
|
||||
if ((error != NULL) && (mSource != NULL))
|
||||
if ((error != NULL) && (mSource != NULL))
|
||||
error->mProject = mSource->mProject;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1266,10 +1266,10 @@ BfExpression* BfReducer::CheckBinaryOperatorPrecedence(BfBinaryOperatorExpressio
|
|||
break;
|
||||
}
|
||||
|
||||
if (auto leftBinaryExpr = BfNodeDynCast<BfBinaryOperatorExpression>(checkBinOpExpression->mLeft))
|
||||
{
|
||||
if (auto leftBinaryExpr = BfNodeDynCast<BfBinaryOperatorExpression>(checkBinOpExpression->mLeft))
|
||||
{
|
||||
deferredChecks.push_back(leftBinaryExpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkBinOpExpression = nextBinaryOperatorExpression;
|
||||
|
@ -2098,15 +2098,15 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
|
|||
}
|
||||
}
|
||||
|
||||
// static int sItrIdx = 0;
|
||||
// sItrIdx++;
|
||||
// int itrIdx = sItrIdx;
|
||||
// if (itrIdx == 197)
|
||||
// {
|
||||
// NOP;
|
||||
// }
|
||||
// static int sItrIdx = 0;
|
||||
// sItrIdx++;
|
||||
// int itrIdx = sItrIdx;
|
||||
// if (itrIdx == 197)
|
||||
// {
|
||||
// NOP;
|
||||
// }
|
||||
|
||||
// BfParenthesizedExpression or BfTupleExpression
|
||||
// BfParenthesizedExpression or BfTupleExpression
|
||||
SetAndRestoreValue<bool> prevInParenExpr(mInParenExpr, true);
|
||||
auto innerExpr = CreateExpressionAfter(tokenNode, CreateExprFlags_AllowVariableDecl);
|
||||
if (innerExpr == NULL)
|
||||
|
@ -6125,14 +6125,14 @@ void BfReducer::ReadPropertyBlock(BfPropertyDeclaration* propertyDeclaration, Bf
|
|||
}
|
||||
if (accessorName == "get")
|
||||
{
|
||||
// if (hadGet)
|
||||
// Fail("Only one 'get' method can be specified", accessorIdentifier);
|
||||
// if (hadGet)
|
||||
// Fail("Only one 'get' method can be specified", accessorIdentifier);
|
||||
hadGet = true;
|
||||
}
|
||||
else if (accessorName == "set")
|
||||
{
|
||||
// if (hadSet)
|
||||
// Fail("Only one 'set' method can be specified", accessorIdentifier);
|
||||
// if (hadSet)
|
||||
// Fail("Only one 'set' method can be specified", accessorIdentifier);
|
||||
hadSet = true;
|
||||
}
|
||||
else
|
||||
|
@ -7616,7 +7616,7 @@ BfAstNode* BfReducer::CreateTopLevelObject(BfTokenNode* tokenNode, BfAttributeDi
|
|||
isSimpleEnum = true;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
checkReadPos++;
|
||||
|
@ -8294,7 +8294,7 @@ BfTokenNode* BfReducer::BreakDoubleChevron(BfTokenNode* tokenNode)
|
|||
tokenNode->GetSrcPositions(triviaStart, srcStart, srcEnd);
|
||||
firstChevron->Init(triviaStart, srcStart, srcEnd - 1);
|
||||
|
||||
tokenNode->SetToken(BfToken_RChevron);
|
||||
tokenNode->SetToken(BfToken_RChevron);
|
||||
tokenNode->SetSrcStart(srcStart + 1);
|
||||
tokenNode->SetTriviaStart(srcStart);
|
||||
|
||||
|
@ -8477,12 +8477,12 @@ BfTokenNode* BfReducer::ParseMethodParams(BfAstNode* node, SizedArrayImpl<BfPara
|
|||
{
|
||||
mVisitorPos.MoveNext();
|
||||
attributes = CreateAttributeDirective(tokenNode);
|
||||
if (attributes != NULL)
|
||||
{
|
||||
nameAfterNode = attributes;
|
||||
auto nextNode = mVisitorPos.GetNext();
|
||||
tokenNode = BfNodeDynCast<BfTokenNode>(nextNode);
|
||||
}
|
||||
if (attributes != NULL)
|
||||
{
|
||||
nameAfterNode = attributes;
|
||||
auto nextNode = mVisitorPos.GetNext();
|
||||
tokenNode = BfNodeDynCast<BfTokenNode>(nextNode);
|
||||
}
|
||||
}
|
||||
|
||||
int paramStartReadPos = mVisitorPos.mReadPos;
|
||||
|
@ -9098,49 +9098,49 @@ BfGenericConstraintsDeclaration* BfReducer::CreateGenericConstraintsDeclaration(
|
|||
addToConstraint = true;
|
||||
break;
|
||||
case BfToken_Operator:
|
||||
{
|
||||
BfGenericOperatorConstraint* opConstraint = mAlloc->Alloc<BfGenericOperatorConstraint>();
|
||||
constraintNode = opConstraint;
|
||||
|
||||
ReplaceNode(constraintToken, opConstraint);
|
||||
|
||||
MEMBER_SET(opConstraint, mOperatorToken, constraintToken);
|
||||
mVisitorPos.MoveNext();
|
||||
|
||||
auto opToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext());
|
||||
if (opToken == NULL)
|
||||
{
|
||||
BfGenericOperatorConstraint* opConstraint = mAlloc->Alloc<BfGenericOperatorConstraint>();
|
||||
constraintNode = opConstraint;
|
||||
|
||||
ReplaceNode(constraintToken, opConstraint);
|
||||
|
||||
MEMBER_SET(opConstraint, mOperatorToken, constraintToken);
|
||||
mVisitorPos.MoveNext();
|
||||
|
||||
auto opToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext());
|
||||
if (opToken == NULL)
|
||||
{
|
||||
auto typeRef = CreateTypeRefAfter(opConstraint, BfReducer::CreateTypeRefFlags_SafeGenericParse);
|
||||
if (typeRef == NULL)
|
||||
break;
|
||||
MEMBER_SET(opConstraint, mLeftType, typeRef);
|
||||
opToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext());
|
||||
|
||||
if (opToken == NULL)
|
||||
{
|
||||
if (auto pointerTypeRef = BfNodeDynCast<BfPointerTypeRef>(typeRef))
|
||||
{
|
||||
MEMBER_SET(opConstraint, mLeftType, pointerTypeRef->mElementType);
|
||||
opToken = pointerTypeRef->mStarNode;
|
||||
MEMBER_SET(opConstraint, mOpToken, opToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opConstraint->mOpToken == NULL)
|
||||
{
|
||||
if (opToken == NULL)
|
||||
break;
|
||||
MEMBER_SET(opConstraint, mOpToken, opToken);
|
||||
mVisitorPos.MoveNext();
|
||||
}
|
||||
|
||||
auto typeRef = CreateTypeRefAfter(opConstraint);
|
||||
auto typeRef = CreateTypeRefAfter(opConstraint, BfReducer::CreateTypeRefFlags_SafeGenericParse);
|
||||
if (typeRef == NULL)
|
||||
break;
|
||||
MEMBER_SET(opConstraint, mRightType, typeRef);
|
||||
MEMBER_SET(opConstraint, mLeftType, typeRef);
|
||||
opToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext());
|
||||
|
||||
if (opToken == NULL)
|
||||
{
|
||||
if (auto pointerTypeRef = BfNodeDynCast<BfPointerTypeRef>(typeRef))
|
||||
{
|
||||
MEMBER_SET(opConstraint, mLeftType, pointerTypeRef->mElementType);
|
||||
opToken = pointerTypeRef->mStarNode;
|
||||
MEMBER_SET(opConstraint, mOpToken, opToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
if (opConstraint->mOpToken == NULL)
|
||||
{
|
||||
if (opToken == NULL)
|
||||
break;
|
||||
MEMBER_SET(opConstraint, mOpToken, opToken);
|
||||
mVisitorPos.MoveNext();
|
||||
}
|
||||
|
||||
auto typeRef = CreateTypeRefAfter(opConstraint);
|
||||
if (typeRef == NULL)
|
||||
break;
|
||||
MEMBER_SET(opConstraint, mRightType, typeRef);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue