mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
More permissive parsing to allow for $"{a ? "b" : "c"}"
This commit is contained in:
parent
c1bc60d964
commit
100e4c7fe8
1 changed files with 7 additions and 1 deletions
|
@ -3488,6 +3488,7 @@ void BfParser::ParseBlock(BfBlock* astNode, int depth, bool isInterpolate)
|
||||||
|
|
||||||
bool isAsmBlock = false;
|
bool isAsmBlock = false;
|
||||||
bool isTernary = false;
|
bool isTernary = false;
|
||||||
|
bool forceAllowNext = false;
|
||||||
|
|
||||||
SizedArray<BfAstNode*, 32> childArr;
|
SizedArray<BfAstNode*, 32> childArr;
|
||||||
|
|
||||||
|
@ -3503,7 +3504,8 @@ void BfParser::ParseBlock(BfBlock* astNode, int depth, bool isInterpolate)
|
||||||
isAsmBlock = true;
|
isAsmBlock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NextToken(-1, isInterpolate && (parenDepth == 0));
|
NextToken(-1, isInterpolate && (parenDepth == 0) && (!forceAllowNext));
|
||||||
|
forceAllowNext = false;
|
||||||
|
|
||||||
if (mPreprocessorIgnoredSectionNode != NULL)
|
if (mPreprocessorIgnoredSectionNode != NULL)
|
||||||
{
|
{
|
||||||
|
@ -3587,7 +3589,10 @@ void BfParser::ParseBlock(BfBlock* astNode, int depth, bool isInterpolate)
|
||||||
if ((isInterpolate) && (parenDepth == 0))
|
if ((isInterpolate) && (parenDepth == 0))
|
||||||
{
|
{
|
||||||
if (mToken == BfToken_Question)
|
if (mToken == BfToken_Question)
|
||||||
|
{
|
||||||
isTernary = true;
|
isTernary = true;
|
||||||
|
forceAllowNext = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool endNow = false;
|
bool endNow = false;
|
||||||
if (mToken == BfToken_Colon)
|
if (mToken == BfToken_Colon)
|
||||||
|
@ -3605,6 +3610,7 @@ void BfParser::ParseBlock(BfBlock* astNode, int depth, bool isInterpolate)
|
||||||
|
|
||||||
if ((endNow) && (isTernary))
|
if ((endNow) && (isTernary))
|
||||||
{
|
{
|
||||||
|
forceAllowNext = true;
|
||||||
isTernary = false;
|
isTernary = false;
|
||||||
endNow = false;
|
endNow = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue