| 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
| 6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } | 750 } |
| 751 ZoneList<v8::internal::Statement*>* NewStatementList(int size, Zone* zone) { | 751 ZoneList<v8::internal::Statement*>* NewStatementList(int size, Zone* zone) { |
| 752 return new(zone) ZoneList<v8::internal::Statement*>(size, zone); | 752 return new(zone) ZoneList<v8::internal::Statement*>(size, zone); |
| 753 } | 753 } |
| 754 V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type, | 754 V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type, |
| 755 FunctionKind kind = kNormalFunction); | 755 FunctionKind kind = kNormalFunction); |
| 756 | 756 |
| 757 V8_INLINE void DeclareFormalParameter(Scope* scope, const AstRawString* name, | 757 V8_INLINE void DeclareFormalParameter(Scope* scope, const AstRawString* name, |
| 758 ExpressionClassifier* classifier, | 758 ExpressionClassifier* classifier, |
| 759 bool is_rest); | 759 bool is_rest); |
| 760 void DeclareArrowFunctionParameters(Scope* scope, Expression* expr, | |
| 761 const Scanner::Location& params_loc, | |
| 762 Scanner::Location* duplicate_loc, | |
| 763 bool* ok); | |
| 764 void ParseArrowFunctionFormalParameters(Scope* scope, Expression* params, | 760 void ParseArrowFunctionFormalParameters(Scope* scope, Expression* params, |
| 765 const Scanner::Location& params_loc, | 761 const Scanner::Location& params_loc, |
| 766 bool* is_rest, | 762 bool* has_rest, |
| 767 Scanner::Location* duplicate_loc, | 763 Scanner::Location* duplicate_loc, |
| 768 bool* ok); | 764 bool* ok); |
| 769 | 765 |
| 770 // Temporary glue; these functions will move to ParserBase. | 766 // Temporary glue; these functions will move to ParserBase. |
| 771 Expression* ParseV8Intrinsic(bool* ok); | 767 Expression* ParseV8Intrinsic(bool* ok); |
| 772 FunctionLiteral* ParseFunctionLiteral( | 768 FunctionLiteral* ParseFunctionLiteral( |
| 773 const AstRawString* name, Scanner::Location function_name_location, | 769 const AstRawString* name, Scanner::Location function_name_location, |
| 774 bool name_is_strict_reserved, FunctionKind kind, | 770 bool name_is_strict_reserved, FunctionKind kind, |
| 775 int function_token_position, FunctionLiteral::FunctionType type, | 771 int function_token_position, FunctionLiteral::FunctionType type, |
| 776 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); | 772 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 var->set_maybe_assigned(); | 1283 var->set_maybe_assigned(); |
| 1288 } | 1284 } |
| 1289 if (is_duplicate) { | 1285 if (is_duplicate) { |
| 1290 classifier->RecordDuplicateFormalParameterError( | 1286 classifier->RecordDuplicateFormalParameterError( |
| 1291 parser_->scanner()->location()); | 1287 parser_->scanner()->location()); |
| 1292 } | 1288 } |
| 1293 } | 1289 } |
| 1294 } } // namespace v8::internal | 1290 } } // namespace v8::internal |
| 1295 | 1291 |
| 1296 #endif // V8_PARSER_H_ | 1292 #endif // V8_PARSER_H_ |
| OLD | NEW |