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_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 294 Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, |
295 bool default_export, bool* ok); | 295 bool default_export, bool* ok); |
296 Statement* ParseNativeDeclaration(bool* ok); | 296 Statement* ParseNativeDeclaration(bool* ok); |
297 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); | 297 Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); |
298 Block* ParseVariableStatement(VariableDeclarationContext var_context, | 298 Block* ParseVariableStatement(VariableDeclarationContext var_context, |
299 ZoneList<const AstRawString*>* names, | 299 ZoneList<const AstRawString*>* names, |
300 bool* ok); | 300 bool* ok); |
301 DoExpression* ParseDoExpression(bool* ok); | 301 DoExpression* ParseDoExpression(bool* ok); |
302 Expression* ParseYieldStarExpression(bool* ok); | 302 Expression* ParseYieldStarExpression(bool* ok); |
303 | 303 |
304 struct DeclarationDescriptor { | |
305 enum Kind { NORMAL, PARAMETER }; | |
306 Parser* parser; | |
307 Scope* scope; | |
308 Scope* hoist_scope; | |
309 VariableMode mode; | |
310 int declaration_pos; | |
311 int initialization_pos; | |
312 Kind declaration_kind; | |
313 }; | |
314 | |
315 struct DeclarationParsingResult { | 304 struct DeclarationParsingResult { |
316 struct Declaration { | 305 struct Declaration { |
317 Declaration(Expression* pattern, int initializer_position, | 306 Declaration(Expression* pattern, int initializer_position, |
318 Expression* initializer) | 307 Expression* initializer) |
319 : pattern(pattern), | 308 : pattern(pattern), |
320 initializer_position(initializer_position), | 309 initializer_position(initializer_position), |
321 initializer(initializer) {} | 310 initializer(initializer) {} |
322 | 311 |
323 Expression* pattern; | 312 Expression* pattern; |
324 int initializer_position; | 313 int initializer_position; |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 static const int kLiteralTypeSlot = 0; | 1076 static const int kLiteralTypeSlot = 0; |
1088 static const int kElementsSlot = 1; | 1077 static const int kElementsSlot = 1; |
1089 | 1078 |
1090 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 1079 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
1091 }; | 1080 }; |
1092 | 1081 |
1093 } // namespace internal | 1082 } // namespace internal |
1094 } // namespace v8 | 1083 } // namespace v8 |
1095 | 1084 |
1096 #endif // V8_PARSING_PARSER_H_ | 1085 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |