OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_EXPRESSION_CLASSIFIER_H | 5 #ifndef V8_EXPRESSION_CLASSIFIER_H |
6 #define V8_EXPRESSION_CLASSIFIER_H | 6 #define V8_EXPRESSION_CLASSIFIER_H |
7 | 7 |
8 #include "src/messages.h" | 8 #include "src/messages.h" |
9 #include "src/scanner.h" | 9 #include "src/scanner.h" |
10 #include "src/token.h" | 10 #include "src/token.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void RecordAssignmentPatternError(const Scanner::Location& loc, | 134 void RecordAssignmentPatternError(const Scanner::Location& loc, |
135 MessageTemplate::Template message, | 135 MessageTemplate::Template message, |
136 const char* arg = nullptr) { | 136 const char* arg = nullptr) { |
137 if (!is_valid_assignment_pattern()) return; | 137 if (!is_valid_assignment_pattern()) return; |
138 invalid_productions_ |= AssignmentPatternProduction; | 138 invalid_productions_ |= AssignmentPatternProduction; |
139 assignment_pattern_error_.location = loc; | 139 assignment_pattern_error_.location = loc; |
140 assignment_pattern_error_.message = message; | 140 assignment_pattern_error_.message = message; |
141 assignment_pattern_error_.arg = arg; | 141 assignment_pattern_error_.arg = arg; |
142 } | 142 } |
143 | 143 |
| 144 void RecordPatternError(const Scanner::Location& loc, |
| 145 MessageTemplate::Template message, |
| 146 const char* arg = nullptr) { |
| 147 RecordBindingPatternError(loc, message, arg); |
| 148 RecordAssignmentPatternError(loc, message, arg); |
| 149 } |
| 150 |
144 void RecordArrowFormalParametersError(const Scanner::Location& loc, | 151 void RecordArrowFormalParametersError(const Scanner::Location& loc, |
145 MessageTemplate::Template message, | 152 MessageTemplate::Template message, |
146 const char* arg = nullptr) { | 153 const char* arg = nullptr) { |
147 if (!is_valid_arrow_formal_parameters()) return; | 154 if (!is_valid_arrow_formal_parameters()) return; |
148 invalid_productions_ |= ArrowFormalParametersProduction; | 155 invalid_productions_ |= ArrowFormalParametersProduction; |
149 arrow_formal_parameters_error_.location = loc; | 156 arrow_formal_parameters_error_.location = loc; |
150 arrow_formal_parameters_error_.message = message; | 157 arrow_formal_parameters_error_.message = message; |
151 arrow_formal_parameters_error_.arg = arg; | 158 arrow_formal_parameters_error_.arg = arg; |
152 } | 159 } |
153 | 160 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 Error arrow_formal_parameters_error_; | 238 Error arrow_formal_parameters_error_; |
232 Error duplicate_formal_parameter_error_; | 239 Error duplicate_formal_parameter_error_; |
233 Error strict_mode_formal_parameter_error_; | 240 Error strict_mode_formal_parameter_error_; |
234 Error strong_mode_formal_parameter_error_; | 241 Error strong_mode_formal_parameter_error_; |
235 DuplicateFinder* duplicate_finder_; | 242 DuplicateFinder* duplicate_finder_; |
236 }; | 243 }; |
237 } | 244 } |
238 } // v8::internal | 245 } // v8::internal |
239 | 246 |
240 #endif // V8_EXPRESSION_CLASSIFIER_H | 247 #endif // V8_EXPRESSION_CLASSIFIER_H |
OLD | NEW |