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_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 } | 862 } |
863 bool is_resumable() const { return function_state_->is_resumable(); } | 863 bool is_resumable() const { return function_state_->is_resumable(); } |
864 | 864 |
865 // Report syntax errors. | 865 // Report syntax errors. |
866 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, | 866 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, |
867 ParseErrorType error_type = kSyntaxError) { | 867 ParseErrorType error_type = kSyntaxError) { |
868 Scanner::Location source_location = scanner()->location(); | 868 Scanner::Location source_location = scanner()->location(); |
869 Traits::ReportMessageAt(source_location, message, arg, error_type); | 869 Traits::ReportMessageAt(source_location, message, arg, error_type); |
870 } | 870 } |
871 | 871 |
| 872 void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, |
| 873 ParseErrorType error_type = kSyntaxError) { |
| 874 Scanner::Location source_location = scanner()->location(); |
| 875 Traits::ReportMessageAt(source_location, message, arg, error_type); |
| 876 } |
| 877 |
872 void ReportMessageAt(Scanner::Location location, | 878 void ReportMessageAt(Scanner::Location location, |
873 MessageTemplate::Template message, | 879 MessageTemplate::Template message, |
| 880 const char* arg = NULL, |
874 ParseErrorType error_type = kSyntaxError) { | 881 ParseErrorType error_type = kSyntaxError) { |
875 Traits::ReportMessageAt(location, message, reinterpret_cast<const char*>(0), | 882 Traits::ReportMessageAt(location, message, arg, error_type); |
876 error_type); | 883 } |
| 884 |
| 885 void ReportMessageAt(Scanner::Location location, |
| 886 MessageTemplate::Template message, |
| 887 const AstRawString* arg, |
| 888 ParseErrorType error_type = kSyntaxError) { |
| 889 Traits::ReportMessageAt(location, message, arg, error_type); |
| 890 } |
| 891 |
| 892 void ReportMessageAt(Scanner::Location location, |
| 893 MessageTemplate::Template message, |
| 894 ParseErrorType error_type) { |
| 895 ReportMessageAt(location, message, static_cast<const char*>(nullptr), |
| 896 error_type); |
877 } | 897 } |
878 | 898 |
879 void GetUnexpectedTokenMessage( | 899 void GetUnexpectedTokenMessage( |
880 Token::Value token, MessageTemplate::Template* message, | 900 Token::Value token, MessageTemplate::Template* message, |
881 Scanner::Location* location, const char** arg, | 901 Scanner::Location* location, const char** arg, |
882 MessageTemplate::Template default_ = MessageTemplate::kUnexpectedToken); | 902 MessageTemplate::Template default_ = MessageTemplate::kUnexpectedToken); |
883 | 903 |
884 void ReportUnexpectedToken(Token::Value token); | 904 void ReportUnexpectedToken(Token::Value token); |
885 void ReportUnexpectedTokenAt( | 905 void ReportUnexpectedTokenAt( |
886 Scanner::Location location, Token::Value token, | 906 Scanner::Location location, Token::Value token, |
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3732 has_seen_constructor_ = true; | 3752 has_seen_constructor_ = true; |
3733 return; | 3753 return; |
3734 } | 3754 } |
3735 } | 3755 } |
3736 | 3756 |
3737 | 3757 |
3738 } // namespace internal | 3758 } // namespace internal |
3739 } // namespace v8 | 3759 } // namespace v8 |
3740 | 3760 |
3741 #endif // V8_PARSING_PARSER_BASE_H | 3761 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |