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/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 typedef Variable GeneratorVariable; | 333 typedef Variable GeneratorVariable; |
334 | 334 |
335 typedef v8::internal::AstProperties AstProperties; | 335 typedef v8::internal::AstProperties AstProperties; |
336 | 336 |
337 typedef v8::internal::ExpressionClassifier<ParserTraits> | 337 typedef v8::internal::ExpressionClassifier<ParserTraits> |
338 ExpressionClassifier; | 338 ExpressionClassifier; |
339 | 339 |
340 // Return types for traversing functions. | 340 // Return types for traversing functions. |
341 typedef const AstRawString* Identifier; | 341 typedef const AstRawString* Identifier; |
| 342 typedef ZoneList<const AstRawString*>* IdentifierList; |
342 typedef v8::internal::Expression* Expression; | 343 typedef v8::internal::Expression* Expression; |
343 typedef Yield* YieldExpression; | 344 typedef Yield* YieldExpression; |
344 typedef v8::internal::FunctionLiteral* FunctionLiteral; | 345 typedef v8::internal::FunctionLiteral* FunctionLiteral; |
345 typedef v8::internal::ClassLiteral* ClassLiteral; | 346 typedef v8::internal::ClassLiteral* ClassLiteral; |
346 typedef v8::internal::Literal* Literal; | 347 typedef v8::internal::Literal* Literal; |
347 typedef ObjectLiteral::Property* ObjectLiteralProperty; | 348 typedef ObjectLiteral::Property* ObjectLiteralProperty; |
348 typedef ZoneList<v8::internal::Expression*>* ExpressionList; | 349 typedef ZoneList<v8::internal::Expression*>* ExpressionList; |
349 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; | 350 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; |
350 typedef ParserFormalParameters::Parameter FormalParameter; | 351 typedef ParserFormalParameters::Parameter FormalParameter; |
351 typedef ParserFormalParameters FormalParameters; | 352 typedef ParserFormalParameters FormalParameters; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 static ZoneList<typesystem::TypeParameter*>* NullTypeParameters() { | 505 static ZoneList<typesystem::TypeParameter*>* NullTypeParameters() { |
505 return nullptr; | 506 return nullptr; |
506 } | 507 } |
507 static bool IsNullTypeParameters( | 508 static bool IsNullTypeParameters( |
508 ZoneList<typesystem::TypeParameter*>* typ_pars) { | 509 ZoneList<typesystem::TypeParameter*>* typ_pars) { |
509 return typ_pars == nullptr; | 510 return typ_pars == nullptr; |
510 } | 511 } |
511 V8_INLINE ZoneList<typesystem::TypeParameter*>* EmptyTypeParameters() const; | 512 V8_INLINE ZoneList<typesystem::TypeParameter*>* EmptyTypeParameters() const; |
512 V8_INLINE ZoneList<typesystem::FormalParameter*>* EmptyFormalParameters() | 513 V8_INLINE ZoneList<typesystem::FormalParameter*>* EmptyFormalParameters() |
513 const; | 514 const; |
| 515 static ZoneList<const AstRawString*>* NullIdentifierList() { return nullptr; } |
| 516 V8_INLINE ZoneList<const AstRawString*>* EmptyIdentifierList() const; |
514 | 517 |
515 // Used in error return values. | 518 // Used in error return values. |
516 static ZoneList<Expression*>* NullExpressionList() { | 519 static ZoneList<Expression*>* NullExpressionList() { |
517 return NULL; | 520 return NULL; |
518 } | 521 } |
519 static const AstRawString* EmptyFormalParameter() { return NULL; } | 522 static const AstRawString* EmptyFormalParameter() { return NULL; } |
520 | 523 |
521 // Non-NULL empty string. | 524 // Non-NULL empty string. |
522 V8_INLINE const AstRawString* EmptyIdentifierString(); | 525 V8_INLINE const AstRawString* EmptyIdentifierString(); |
523 | 526 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 } | 1124 } |
1122 | 1125 |
1123 | 1126 |
1124 ZoneList<typesystem::FormalParameter*>* ParserTraits::EmptyFormalParameters() | 1127 ZoneList<typesystem::FormalParameter*>* ParserTraits::EmptyFormalParameters() |
1125 const { | 1128 const { |
1126 return new (parser_->zone()) | 1129 return new (parser_->zone()) |
1127 ZoneList<typesystem::FormalParameter*>(1, parser_->zone()); | 1130 ZoneList<typesystem::FormalParameter*>(1, parser_->zone()); |
1128 } | 1131 } |
1129 | 1132 |
1130 | 1133 |
| 1134 ZoneList<const AstRawString*>* ParserTraits::EmptyIdentifierList() const { |
| 1135 return new (parser_->zone()) |
| 1136 ZoneList<const AstRawString*>(1, parser_->zone()); |
| 1137 } |
| 1138 |
| 1139 |
1131 const AstRawString* ParserTraits::EmptyIdentifierString() { | 1140 const AstRawString* ParserTraits::EmptyIdentifierString() { |
1132 return parser_->ast_value_factory()->empty_string(); | 1141 return parser_->ast_value_factory()->empty_string(); |
1133 } | 1142 } |
1134 | 1143 |
1135 | 1144 |
1136 void ParserTraits::SkipLazyFunctionBody(int* materialized_literal_count, | 1145 void ParserTraits::SkipLazyFunctionBody(int* materialized_literal_count, |
1137 int* expected_property_count, bool* ok, | 1146 int* expected_property_count, bool* ok, |
1138 Scanner::BookmarkScope* bookmark) { | 1147 Scanner::BookmarkScope* bookmark) { |
1139 return parser_->SkipLazyFunctionBody(materialized_literal_count, | 1148 return parser_->SkipLazyFunctionBody(materialized_literal_count, |
1140 expected_property_count, ok, bookmark); | 1149 expected_property_count, ok, bookmark); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 | 1292 |
1284 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1293 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1285 return parser_->ParseDoExpression(ok); | 1294 return parser_->ParseDoExpression(ok); |
1286 } | 1295 } |
1287 | 1296 |
1288 | 1297 |
1289 } // namespace internal | 1298 } // namespace internal |
1290 } // namespace v8 | 1299 } // namespace v8 |
1291 | 1300 |
1292 #endif // V8_PARSING_PARSER_H_ | 1301 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |