@@ -256,8 +256,8 @@ HRESULT Parser::ValidateSyntax(LPCUTF8 pszSrc, size_t encodedCharCount, bool isG
256
256
257
257
// Give the scanner the source and get the first token
258
258
m_pscan->SetText (pszSrc, 0 , encodedCharCount, 0 , grfscr);
259
- m_pscan->SetYieldIsKeyword (isGenerator);
260
- m_pscan->SetAwaitIsKeyword (isAsync);
259
+ m_pscan->SetYieldIsKeywordRegion (isGenerator);
260
+ m_pscan->SetAwaitIsKeywordRegion (isAsync);
261
261
m_pscan->Scan ();
262
262
263
263
uint nestedCount = 0 ;
@@ -2929,9 +2929,9 @@ ParseNodePtr Parser::ParseTerm(BOOL fAllowCall,
2929
2929
isAsyncExpr = true ;
2930
2930
}
2931
2931
2932
- bool previousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (isAsyncExpr);
2932
+ bool previousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (isAsyncExpr);
2933
2933
m_pscan->Scan ();
2934
- m_pscan->SetAwaitIsKeyword (previousAwaitIsKeyword);
2934
+ m_pscan->SetAwaitIsKeywordRegion (previousAwaitIsKeyword);
2935
2935
2936
2936
// We search for an Async expression (a function declaration or an async lambda expression)
2937
2937
if (isAsyncExpr && !m_pscan->FHadNewLine ())
@@ -4983,9 +4983,9 @@ bool Parser::ParseFncDeclHelper(ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, usho
4983
4983
4984
4984
// switch scanner to treat 'yield' as keyword in generator functions
4985
4985
// or as an identifier in non-generator functions
4986
- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
4986
+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
4987
4987
4988
- bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (fAsync );
4988
+ bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (fAsync );
4989
4989
4990
4990
if (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ())
4991
4991
{
@@ -5491,8 +5491,8 @@ bool Parser::ParseFncDeclHelper(ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, usho
5491
5491
m_grfscr |= uDeferSave;
5492
5492
}
5493
5493
5494
- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
5495
- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
5494
+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
5495
+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
5496
5496
5497
5497
// Restore the current function.
5498
5498
if (buildAST)
@@ -6069,9 +6069,9 @@ bool Parser::ParseFncNames(ParseNodePtr pnodeFnc, ParseNodePtr pnodeFncParent, u
6069
6069
{
6070
6070
if (!fDeclaration )
6071
6071
{
6072
- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (!fDeclaration );
6072
+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (!fDeclaration );
6073
6073
m_pscan->Scan ();
6074
- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6074
+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6075
6075
}
6076
6076
else
6077
6077
{
@@ -6212,8 +6212,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
6212
6212
6213
6213
if (fLambda )
6214
6214
{
6215
- fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsGenerator ());
6216
- fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (fAsync || (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsAsync ()));
6215
+ fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsGenerator ());
6216
+ fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (fAsync || (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsAsync ()));
6217
6217
}
6218
6218
6219
6219
Assert (!fNoArg || !fOneArg ); // fNoArg and fOneArg can never be true at the same time.
@@ -6243,8 +6243,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
6243
6243
6244
6244
if (fLambda )
6245
6245
{
6246
- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6247
- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6246
+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6247
+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
6248
6248
}
6249
6249
6250
6250
return ;
@@ -6494,8 +6494,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
6494
6494
6495
6495
if (fLambda )
6496
6496
{
6497
- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6498
- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6497
+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6498
+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
6499
6499
}
6500
6500
}
6501
6501
@@ -6826,9 +6826,9 @@ void Parser::FinishFncNode(ParseNodePtr pnodeFnc)
6826
6826
6827
6827
// switch scanner to treat 'yield' as keyword in generator functions
6828
6828
// or as an identifier in non-generator functions
6829
- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
6829
+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
6830
6830
6831
- bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsAsync ());
6831
+ bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsAsync ());
6832
6832
6833
6833
// Skip the arg list.
6834
6834
m_pscan->ScanNoKeywords ();
@@ -6923,8 +6923,8 @@ void Parser::FinishFncNode(ParseNodePtr pnodeFnc)
6923
6923
Assert (tempNextFunctionId == pnodeFnc->sxFnc .deferredParseNextFunctionId );
6924
6924
this ->m_nextFunctionId = nextFunctionIdSave;
6925
6925
6926
- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6927
- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6926
+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6927
+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
6928
6928
}
6929
6929
6930
6930
void Parser::FinishFncDecl (ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, ParseNodePtr *lastNodeRef, bool skipCurlyBraces)
@@ -8115,10 +8115,10 @@ ParseNodePtr Parser::ParseExpr(int oplMin,
8115
8115
8116
8116
if (nop == knopYield)
8117
8117
{
8118
- if (!m_pscan->YieldIsKeyword () || oplMin > opl)
8118
+ if (!m_pscan->YieldIsKeywordRegion () || oplMin > opl)
8119
8119
{
8120
8120
// The case where 'yield' is scanned as a keyword (tkYIELD) but the scanner
8121
- // is not treating yield as a keyword (!m_pscan->YieldIsKeyword ()) occurs
8121
+ // is not treating yield as a keyword (!m_pscan->YieldIsKeywordRegion ()) occurs
8122
8122
// in strict mode non-generator function contexts.
8123
8123
//
8124
8124
// That is, 'yield' is a keyword because of strict mode, but YieldExpression
@@ -8135,7 +8135,7 @@ ParseNodePtr Parser::ParseExpr(int oplMin,
8135
8135
}
8136
8136
else if (nop == knopAwait)
8137
8137
{
8138
- if (!m_pscan->AwaitIsKeyword () ||
8138
+ if (!m_pscan->AwaitIsKeywordRegion () ||
8139
8139
m_currentScope->GetScopeType () == ScopeType_Parameter)
8140
8140
{
8141
8141
// As with the 'yield' keyword, the case where 'await' is scanned as a keyword (tkAWAIT)
0 commit comments