Skip to content

Commit bd11fc9

Browse files
Move struct definition to Parse.h from Parse.cpp
The structure of the struct is needed in a function in Parse.h
1 parent 2d5d515 commit bd11fc9

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

lib/Parser/Parse.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,6 @@ bool Parser::IsES6DestructuringEnabled() const
3131
return m_scriptContext->GetConfig()->IsES6DestructuringEnabled();
3232
}
3333

34-
struct StmtNest
35-
{
36-
union
37-
{
38-
struct
39-
{
40-
ParseNodeStmt * pnodeStmt; // This statement node.
41-
};
42-
struct
43-
{
44-
bool isDeferred : 1;
45-
OpCode op; // This statement operation.
46-
};
47-
};
48-
LabelId* pLabelId; // Labels for this statement.
49-
StmtNest *pstmtOuter; // Enclosing statement.
50-
51-
OpCode GetNop() const
52-
{
53-
AnalysisAssert(isDeferred || pnodeStmt != nullptr);
54-
return isDeferred ? op : pnodeStmt->nop;
55-
}
56-
};
57-
5834
struct BlockInfoStack
5935
{
6036
StmtNest pstmt;

lib/Parser/Parse.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,32 @@ struct PidRefStack;
7676

7777
struct DeferredFunctionStub;
7878

79-
struct StmtNest;
8079
struct BlockInfoStack;
80+
81+
struct StmtNest
82+
{
83+
union
84+
{
85+
struct
86+
{
87+
ParseNodeStmt * pnodeStmt; // This statement node.
88+
};
89+
struct
90+
{
91+
bool isDeferred : 1;
92+
OpCode op; // This statement operation.
93+
};
94+
};
95+
LabelId* pLabelId; // Labels for this statement.
96+
StmtNest *pstmtOuter; // Enclosing statement.
97+
98+
inline OpCode GetNop() const
99+
{
100+
AnalysisAssert(isDeferred || pnodeStmt != nullptr);
101+
return isDeferred ? op : pnodeStmt->nop;
102+
}
103+
};
104+
81105
struct ParseContext
82106
{
83107
LPCUTF8 pszSrc;

0 commit comments

Comments
 (0)