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" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
| 11 #include "src/pending-compilation-error-handler.h" |
11 #include "src/preparse-data.h" | 12 #include "src/preparse-data.h" |
12 #include "src/preparse-data-format.h" | 13 #include "src/preparse-data-format.h" |
13 #include "src/preparser.h" | 14 #include "src/preparser.h" |
14 #include "src/scopes.h" | 15 #include "src/scopes.h" |
15 | 16 |
16 namespace v8 { | 17 namespace v8 { |
17 class ScriptCompiler; | 18 class ScriptCompiler; |
18 | 19 |
19 namespace internal { | 20 namespace internal { |
20 | 21 |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 const AstRawString* GetNumberAsSymbol(Scanner* scanner); | 535 const AstRawString* GetNumberAsSymbol(Scanner* scanner); |
535 | 536 |
536 Expression* ThisExpression(Scope* scope, AstNodeFactory* factory, | 537 Expression* ThisExpression(Scope* scope, AstNodeFactory* factory, |
537 int pos = RelocInfo::kNoPosition); | 538 int pos = RelocInfo::kNoPosition); |
538 Expression* SuperReference(Scope* scope, AstNodeFactory* factory, | 539 Expression* SuperReference(Scope* scope, AstNodeFactory* factory, |
539 int pos = RelocInfo::kNoPosition); | 540 int pos = RelocInfo::kNoPosition); |
540 Expression* DefaultConstructor(bool call_super, Scope* scope, int pos, | 541 Expression* DefaultConstructor(bool call_super, Scope* scope, int pos, |
541 int end_pos); | 542 int end_pos); |
542 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner, | 543 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner, |
543 AstNodeFactory* factory); | 544 AstNodeFactory* factory); |
544 Expression* ExpressionFromIdentifier(const AstRawString* name, int pos, | 545 Expression* ExpressionFromIdentifier(const AstRawString* name, |
| 546 int start_position, int end_position, |
545 Scope* scope, AstNodeFactory* factory); | 547 Scope* scope, AstNodeFactory* factory); |
546 Expression* ExpressionFromString(int pos, Scanner* scanner, | 548 Expression* ExpressionFromString(int pos, Scanner* scanner, |
547 AstNodeFactory* factory); | 549 AstNodeFactory* factory); |
548 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory); | 550 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory); |
549 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { | 551 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { |
550 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); | 552 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); |
551 } | 553 } |
552 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { | 554 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { |
553 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); | 555 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); |
554 } | 556 } |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 838 |
837 Scanner scanner_; | 839 Scanner scanner_; |
838 PreParser* reusable_preparser_; | 840 PreParser* reusable_preparser_; |
839 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 841 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
840 Target* target_stack_; // for break, continue statements | 842 Target* target_stack_; // for break, continue statements |
841 ScriptCompiler::CompileOptions compile_options_; | 843 ScriptCompiler::CompileOptions compile_options_; |
842 ParseData* cached_parse_data_; | 844 ParseData* cached_parse_data_; |
843 | 845 |
844 bool parsing_lazy_arrow_parameters_; // for lazily parsed arrow functions. | 846 bool parsing_lazy_arrow_parameters_; // for lazily parsed arrow functions. |
845 | 847 |
846 // Pending errors. | 848 PendingCompilationErrorHandler pending_error_handler_; |
847 bool has_pending_error_; | |
848 Scanner::Location pending_error_location_; | |
849 const char* pending_error_message_; | |
850 const AstRawString* pending_error_arg_; | |
851 const char* pending_error_char_arg_; | |
852 ParseErrorType pending_error_type_; | |
853 | 849 |
854 // Other information which will be stored in Parser and moved to Isolate after | 850 // Other information which will be stored in Parser and moved to Isolate after |
855 // parsing. | 851 // parsing. |
856 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; | 852 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; |
857 int total_preparse_skipped_; | 853 int total_preparse_skipped_; |
858 HistogramTimer* pre_parse_timer_; | 854 HistogramTimer* pre_parse_timer_; |
859 | 855 |
860 bool parsing_on_main_thread_; | 856 bool parsing_on_main_thread_; |
861 }; | 857 }; |
862 | 858 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 } | 941 } |
946 | 942 |
947 | 943 |
948 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 944 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
949 int start, Expression* tag) { | 945 int start, Expression* tag) { |
950 return parser_->CloseTemplateLiteral(state, start, tag); | 946 return parser_->CloseTemplateLiteral(state, start, tag); |
951 } | 947 } |
952 } } // namespace v8::internal | 948 } } // namespace v8::internal |
953 | 949 |
954 #endif // V8_PARSER_H_ | 950 #endif // V8_PARSER_H_ |
OLD | NEW |