@@ -280,9 +280,9 @@ class Parser
280
280
ParseNodePtr CreateNameNode (IdentPtr pid)
281
281
{
282
282
ParseNodePtr pnode = CreateNode (knopName);
283
- pnode->sxPid . pid = pid;
284
- pnode->sxPid . sym =NULL ;
285
- pnode->sxPid . symRef =NULL ;
283
+ pnode->AsParseNodePid ()-> pid = pid;
284
+ pnode->AsParseNodePid ()-> sym =NULL ;
285
+ pnode->AsParseNodePid ()-> symRef =NULL ;
286
286
return pnode;
287
287
}
288
288
ParseNodePtr CreateSpecialNameNode (IdentPtr pid)
@@ -291,12 +291,12 @@ class Parser
291
291
292
292
// knopSpecialName is unused in the code
293
293
pnode->nop = knopName;
294
- pnode->sxPid . pid = pid;
295
- pnode->sxPid . sym = NULL ;
296
- pnode->sxPid . symRef = NULL ;
294
+ pnode->AsParseNodePid ()-> pid = pid;
295
+ pnode->AsParseNodePid ()-> sym = NULL ;
296
+ pnode->AsParseNodePid ()-> symRef = NULL ;
297
297
pnode->isSpecialName = true ;
298
- pnode->sxSpecialName . isThis = false ;
299
- pnode->sxSpecialName . isSuper = false ;
298
+ pnode->AsParseNodeSpecialName ()-> isThis = false ;
299
+ pnode->AsParseNodeSpecialName ()-> isSuper = false ;
300
300
return pnode;
301
301
}
302
302
ParseNodePtr CreateBlockNode (PnodeBlockType blockType = PnodeBlockType::Regular)
@@ -509,8 +509,8 @@ class Parser
509
509
{
510
510
if (buildAST)
511
511
{
512
- pnode->sxStmt . grfnop = 0 ;
513
- pnode->sxStmt . pnodeOuter = (NULL == m_pstmtCur) ? NULL : m_pstmtCur->pnodeStmt ;
512
+ pnode->AsParseNodeStmt ()-> grfnop = 0 ;
513
+ pnode->AsParseNodeStmt ()-> pnodeOuter = (NULL == m_pstmtCur) ? NULL : m_pstmtCur->pnodeStmt ;
514
514
515
515
pStmt->pnodeStmt = pnode;
516
516
}
@@ -538,12 +538,12 @@ class Parser
538
538
if (this ->GetCurrentFunctionNode ())
539
539
{
540
540
ParseNodePtr pnodeFunc = GetCurrentFunctionNode ();
541
- pnodeFunc->sxFnc . SetCallsEval (true );
541
+ pnodeFunc->AsParseNodeFnc ()-> SetCallsEval (true );
542
542
}
543
543
ParseNode *pnodeBlock = GetCurrentBlock ();
544
544
if (pnodeBlock != NULL )
545
545
{
546
- pnodeBlock->sxBlock . SetCallsEval (true );
546
+ pnodeBlock->AsParseNodeBlock ()-> SetCallsEval (true );
547
547
PushDynamicBlock ();
548
548
}
549
549
}
@@ -613,10 +613,10 @@ class Parser
613
613
{
614
614
if ((*current)->nop == knopList)
615
615
{
616
- handler (&(*current)->sxBin . pnode1 );
616
+ handler (&(*current)->AsParseNodeBin ()-> pnode1 );
617
617
618
618
// Advance to the next node
619
- current = &(*current)->sxBin . pnode2 ;
619
+ current = &(*current)->AsParseNodeBin ()-> pnode2 ;
620
620
}
621
621
else
622
622
{
@@ -642,11 +642,11 @@ class Parser
642
642
ParseNodePtr bindIdentNode = elementNode;
643
643
if (bindIdentNode->nop == knopAsg)
644
644
{
645
- bindIdentNode = bindIdentNode->sxBin . pnode1 ;
645
+ bindIdentNode = bindIdentNode->AsParseNodeBin ()-> pnode1 ;
646
646
}
647
647
else if (bindIdentNode->nop == knopEllipsis)
648
648
{
649
- bindIdentNode = bindIdentNode->sxUni . pnode1 ;
649
+ bindIdentNode = bindIdentNode->AsParseNodeUni ()-> pnode1 ;
650
650
}
651
651
652
652
if (bindIdentNode->IsPattern ())
@@ -668,21 +668,21 @@ class Parser
668
668
{
669
669
if (patternNode->nop == knopAsg)
670
670
{
671
- patternNode = patternNode->sxBin . pnode1 ;
671
+ patternNode = patternNode->AsParseNodeBin ()-> pnode1 ;
672
672
}
673
673
674
674
Assert (patternNode->IsPattern ());
675
675
if (patternNode->nop == knopArrayPattern)
676
676
{
677
- ForEachItemInList (patternNode->sxArrLit . pnode1 , [&](ParseNodePtr item) {
677
+ ForEachItemInList (patternNode->AsParseNodeArrLit ()-> pnode1 , [&](ParseNodePtr item) {
678
678
MapBindIdentifierFromElement (item, handler);
679
679
});
680
680
}
681
681
else
682
682
{
683
- ForEachItemInList (patternNode->sxUni . pnode1 , [&](ParseNodePtr item) {
683
+ ForEachItemInList (patternNode->AsParseNodeUni ()-> pnode1 , [&](ParseNodePtr item) {
684
684
Assert (item->nop == knopObjectPatternMember);
685
- MapBindIdentifierFromElement (item->sxBin . pnode2 , handler);
685
+ MapBindIdentifierFromElement (item->AsParseNodeBin ()-> pnode2 , handler);
686
686
});
687
687
}
688
688
}
@@ -906,7 +906,7 @@ class Parser
906
906
BOOL NodeIsSuperName (ParseNodePtr pnode);
907
907
BOOL IsJSONValid (ParseNodePtr pnodeExpr)
908
908
{
909
- OpCode jnop = (knopNeg == pnodeExpr->nop ) ? pnodeExpr->sxUni . pnode1 ->nop : pnodeExpr->nop ;
909
+ OpCode jnop = (knopNeg == pnodeExpr->nop ) ? pnodeExpr->AsParseNodeUni ()-> pnode1 ->nop : pnodeExpr->nop ;
910
910
if (knopNeg == pnodeExpr->nop )
911
911
{
912
912
return (knopInt == jnop || knopFlt == jnop);
0 commit comments