| 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_PARSING_EXPRESSION_CLASSIFIER_H | 5 #ifndef V8_PARSING_EXPRESSION_CLASSIFIER_H |
| 6 #define V8_PARSING_EXPRESSION_CLASSIFIER_H | 6 #define V8_PARSING_EXPRESSION_CLASSIFIER_H |
| 7 | 7 |
| 8 #include "src/messages.h" | 8 #include "src/messages.h" |
| 9 #include "src/parsing/scanner.h" | 9 #include "src/parsing/scanner.h" |
| 10 | 10 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 if (invalid_productions_ & (1 << kind)) { | 403 if (invalid_productions_ & (1 << kind)) { |
| 404 for (int i = reported_errors_begin_; i < reported_errors_end_; i++) { | 404 for (int i = reported_errors_begin_; i < reported_errors_end_; i++) { |
| 405 if (reported_errors_->at(i).kind == kind) | 405 if (reported_errors_->at(i).kind == kind) |
| 406 return reported_errors_->at(i); | 406 return reported_errors_->at(i); |
| 407 } | 407 } |
| 408 UNREACHABLE(); | 408 UNREACHABLE(); |
| 409 } | 409 } |
| 410 // We should only be looking for an error when we know that one has | 410 // We should only be looking for an error when we know that one has |
| 411 // been reported. But we're not... So this is to make sure we have | 411 // been reported. But we're not... So this is to make sure we have |
| 412 // the same behaviour. | 412 // the same behaviour. |
| 413 UNREACHABLE(); |
| 414 |
| 415 // Make MSVC happy by returning an error from this inaccessible path. |
| 413 static Error none; | 416 static Error none; |
| 414 return none; | 417 return none; |
| 415 } | 418 } |
| 416 | 419 |
| 417 // Adds e to the end of the list of reported errors for this classifier. | 420 // Adds e to the end of the list of reported errors for this classifier. |
| 418 // It is expected that this classifier is the last one in the stack. | 421 // It is expected that this classifier is the last one in the stack. |
| 419 V8_INLINE void Add(const Error& e) { | 422 V8_INLINE void Add(const Error& e) { |
| 420 DCHECK_EQ(reported_errors_end_, reported_errors_->length()); | 423 DCHECK_EQ(reported_errors_end_, reported_errors_->length()); |
| 421 reported_errors_->Add(e, zone_); | 424 reported_errors_->Add(e, zone_); |
| 422 reported_errors_end_++; | 425 reported_errors_end_++; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 }; | 466 }; |
| 464 | 467 |
| 465 | 468 |
| 466 #undef ERROR_CODES | 469 #undef ERROR_CODES |
| 467 | 470 |
| 468 | 471 |
| 469 } // namespace internal | 472 } // namespace internal |
| 470 } // namespace v8 | 473 } // namespace v8 |
| 471 | 474 |
| 472 #endif // V8_PARSING_EXPRESSION_CLASSIFIER_H | 475 #endif // V8_PARSING_EXPRESSION_CLASSIFIER_H |
| OLD | NEW |