@@ -256,8 +256,8 @@ HRESULT Parser::ValidateSyntax(LPCUTF8 pszSrc, size_t encodedCharCount, bool isG
256256
257257 // Give the scanner the source and get the first token
258258 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);
261261 m_pscan->Scan ();
262262
263263 uint nestedCount = 0 ;
@@ -2929,9 +2929,9 @@ ParseNodePtr Parser::ParseTerm(BOOL fAllowCall,
29292929 isAsyncExpr = true ;
29302930 }
29312931
2932- bool previousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (isAsyncExpr);
2932+ bool previousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (isAsyncExpr);
29332933 m_pscan->Scan ();
2934- m_pscan->SetAwaitIsKeyword (previousAwaitIsKeyword);
2934+ m_pscan->SetAwaitIsKeywordRegion (previousAwaitIsKeyword);
29352935
29362936 // We search for an Async expression (a function declaration or an async lambda expression)
29372937 if (isAsyncExpr && !m_pscan->FHadNewLine ())
@@ -4979,9 +4979,9 @@ bool Parser::ParseFncDeclHelper(ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, usho
49794979
49804980 // switch scanner to treat 'yield' as keyword in generator functions
49814981 // or as an identifier in non-generator functions
4982- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
4982+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
49834983
4984- bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (fAsync );
4984+ bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (fAsync );
49854985
49864986 if (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ())
49874987 {
@@ -5484,8 +5484,8 @@ bool Parser::ParseFncDeclHelper(ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, usho
54845484 m_grfscr |= uDeferSave;
54855485 }
54865486
5487- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
5488- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
5487+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
5488+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
54895489
54905490 // Restore the current function.
54915491 if (buildAST)
@@ -6062,9 +6062,9 @@ bool Parser::ParseFncNames(ParseNodePtr pnodeFnc, ParseNodePtr pnodeFncParent, u
60626062 {
60636063 if (!fDeclaration )
60646064 {
6065- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (!fDeclaration );
6065+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (!fDeclaration );
60666066 m_pscan->Scan ();
6067- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6067+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
60686068 }
60696069 else
60706070 {
@@ -6205,8 +6205,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
62056205
62066206 if (fLambda )
62076207 {
6208- fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsGenerator ());
6209- fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (fAsync || (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsAsync ()));
6208+ fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsGenerator ());
6209+ fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (fAsync || (pnodeParentFnc != nullptr && pnodeParentFnc->sxFnc .IsAsync ()));
62106210 }
62116211
62126212 Assert (!fNoArg || !fOneArg ); // fNoArg and fOneArg can never be true at the same time.
@@ -6236,8 +6236,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
62366236
62376237 if (fLambda )
62386238 {
6239- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6240- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6239+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6240+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
62416241 }
62426242
62436243 return ;
@@ -6487,8 +6487,8 @@ void Parser::ParseFncFormals(ParseNodePtr pnodeFnc, ParseNodePtr pnodeParentFnc,
64876487
64886488 if (fLambda )
64896489 {
6490- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6491- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6490+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6491+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
64926492 }
64936493}
64946494
@@ -6819,9 +6819,9 @@ void Parser::FinishFncNode(ParseNodePtr pnodeFnc)
68196819
68206820 // switch scanner to treat 'yield' as keyword in generator functions
68216821 // or as an identifier in non-generator functions
6822- bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
6822+ bool fPreviousYieldIsKeyword = m_pscan->SetYieldIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsGenerator ());
68236823
6824- bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeyword (pnodeFnc && pnodeFnc->sxFnc .IsAsync ());
6824+ bool fPreviousAwaitIsKeyword = m_pscan->SetAwaitIsKeywordRegion (pnodeFnc && pnodeFnc->sxFnc .IsAsync ());
68256825
68266826 // Skip the arg list.
68276827 m_pscan->ScanNoKeywords ();
@@ -6916,8 +6916,8 @@ void Parser::FinishFncNode(ParseNodePtr pnodeFnc)
69166916 Assert (tempNextFunctionId == pnodeFnc->sxFnc .deferredParseNextFunctionId );
69176917 this ->m_nextFunctionId = nextFunctionIdSave;
69186918
6919- m_pscan->SetYieldIsKeyword (fPreviousYieldIsKeyword );
6920- m_pscan->SetAwaitIsKeyword (fPreviousAwaitIsKeyword );
6919+ m_pscan->SetYieldIsKeywordRegion (fPreviousYieldIsKeyword );
6920+ m_pscan->SetAwaitIsKeywordRegion (fPreviousAwaitIsKeyword );
69216921}
69226922
69236923void Parser::FinishFncDecl (ParseNodePtr pnodeFnc, LPCOLESTR pNameHint, ParseNodePtr *lastNodeRef, bool skipCurlyBraces)
@@ -8108,10 +8108,10 @@ ParseNodePtr Parser::ParseExpr(int oplMin,
81088108
81098109 if (nop == knopYield)
81108110 {
8111- if (!m_pscan->YieldIsKeyword () || oplMin > opl)
8111+ if (!m_pscan->YieldIsKeywordRegion () || oplMin > opl)
81128112 {
81138113 // The case where 'yield' is scanned as a keyword (tkYIELD) but the scanner
8114- // is not treating yield as a keyword (!m_pscan->YieldIsKeyword ()) occurs
8114+ // is not treating yield as a keyword (!m_pscan->YieldIsKeywordRegion ()) occurs
81158115 // in strict mode non-generator function contexts.
81168116 //
81178117 // That is, 'yield' is a keyword because of strict mode, but YieldExpression
@@ -8128,7 +8128,7 @@ ParseNodePtr Parser::ParseExpr(int oplMin,
81288128 }
81298129 else if (nop == knopAwait)
81308130 {
8131- if (!m_pscan->AwaitIsKeyword () ||
8131+ if (!m_pscan->AwaitIsKeywordRegion () ||
81328132 m_currentScope->GetScopeType () == ScopeType_Parameter)
81338133 {
81348134 // As with the 'yield' keyword, the case where 'await' is scanned as a keyword (tkAWAIT)
0 commit comments