OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PREPARSER_H | 5 #ifndef V8_PREPARSER_H |
6 #define V8_PREPARSER_H | 6 #define V8_PREPARSER_H |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 PARSE_LAZILY, | 155 PARSE_LAZILY, |
156 PARSE_EAGERLY | 156 PARSE_EAGERLY |
157 }; | 157 }; |
158 | 158 |
159 enum VariableDeclarationContext { | 159 enum VariableDeclarationContext { |
160 kStatementListItem, | 160 kStatementListItem, |
161 kStatement, | 161 kStatement, |
162 kForStatement | 162 kForStatement |
163 }; | 163 }; |
164 | 164 |
165 // If a list of variable declarations includes any initializers. | |
166 enum VariableDeclarationProperties { kHasInitializers, kHasNoInitializers }; | |
167 | |
168 class Checkpoint; | 165 class Checkpoint; |
169 class ObjectLiteralCheckerBase; | 166 class ObjectLiteralCheckerBase; |
170 | 167 |
171 // --------------------------------------------------------------------------- | 168 // --------------------------------------------------------------------------- |
172 // FunctionState and BlockState together implement the parser's scope stack. | 169 // FunctionState and BlockState together implement the parser's scope stack. |
173 // The parser's current scope is in scope_. BlockState and FunctionState | 170 // The parser's current scope is in scope_. BlockState and FunctionState |
174 // constructors push on the scope stack and the destructors pop. They are also | 171 // constructors push on the scope stack and the destructors pop. They are also |
175 // used to hold the parser's per-function and per-block state. | 172 // used to hold the parser's per-function and per-block state. |
176 class BlockState BASE_EMBEDDED { | 173 class BlockState BASE_EMBEDDED { |
177 public: | 174 public: |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 Statement ParseStatementListItem(bool* ok); | 1578 Statement ParseStatementListItem(bool* ok); |
1582 void ParseStatementList(int end_token, bool* ok); | 1579 void ParseStatementList(int end_token, bool* ok); |
1583 Statement ParseStatement(bool* ok); | 1580 Statement ParseStatement(bool* ok); |
1584 Statement ParseSubStatement(bool* ok); | 1581 Statement ParseSubStatement(bool* ok); |
1585 Statement ParseFunctionDeclaration(bool* ok); | 1582 Statement ParseFunctionDeclaration(bool* ok); |
1586 Statement ParseClassDeclaration(bool* ok); | 1583 Statement ParseClassDeclaration(bool* ok); |
1587 Statement ParseBlock(bool* ok); | 1584 Statement ParseBlock(bool* ok); |
1588 Statement ParseVariableStatement(VariableDeclarationContext var_context, | 1585 Statement ParseVariableStatement(VariableDeclarationContext var_context, |
1589 bool* ok); | 1586 bool* ok); |
1590 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, | 1587 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, |
1591 VariableDeclarationProperties* decl_props, | |
1592 int* num_decl, | 1588 int* num_decl, |
| 1589 Scanner::Location* first_initializer_loc, |
1593 bool* ok); | 1590 bool* ok); |
1594 Statement ParseExpressionOrLabelledStatement(bool* ok); | 1591 Statement ParseExpressionOrLabelledStatement(bool* ok); |
1595 Statement ParseIfStatement(bool* ok); | 1592 Statement ParseIfStatement(bool* ok); |
1596 Statement ParseContinueStatement(bool* ok); | 1593 Statement ParseContinueStatement(bool* ok); |
1597 Statement ParseBreakStatement(bool* ok); | 1594 Statement ParseBreakStatement(bool* ok); |
1598 Statement ParseReturnStatement(bool* ok); | 1595 Statement ParseReturnStatement(bool* ok); |
1599 Statement ParseWithStatement(bool* ok); | 1596 Statement ParseWithStatement(bool* ok); |
1600 Statement ParseSwitchStatement(bool* ok); | 1597 Statement ParseSwitchStatement(bool* ok); |
1601 Statement ParseDoWhileStatement(bool* ok); | 1598 Statement ParseDoWhileStatement(bool* ok); |
1602 Statement ParseWhileStatement(bool* ok); | 1599 Statement ParseWhileStatement(bool* ok); |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3157 *ok = false; | 3154 *ok = false; |
3158 return; | 3155 return; |
3159 } | 3156 } |
3160 has_seen_constructor_ = true; | 3157 has_seen_constructor_ = true; |
3161 return; | 3158 return; |
3162 } | 3159 } |
3163 } | 3160 } |
3164 } } // v8::internal | 3161 } } // v8::internal |
3165 | 3162 |
3166 #endif // V8_PREPARSER_H | 3163 #endif // V8_PREPARSER_H |
OLD | NEW |