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 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2422 ~ExpressionClassifier::AssignmentPatternProduction; | 2422 ~ExpressionClassifier::AssignmentPatternProduction; |
2423 } else { | 2423 } else { |
2424 productions |= ExpressionClassifier::PatternProductions; | 2424 productions |= ExpressionClassifier::PatternProductions; |
2425 } | 2425 } |
2426 | 2426 |
2427 const bool is_destructuring_assignment = | 2427 const bool is_destructuring_assignment = |
2428 IsValidPattern(expression) && peek() == Token::ASSIGN; | 2428 IsValidPattern(expression) && peek() == Token::ASSIGN; |
2429 if (!is_destructuring_assignment) { | 2429 if (!is_destructuring_assignment) { |
2430 // This may be an expression or a pattern, so we must continue to | 2430 // This may be an expression or a pattern, so we must continue to |
2431 // accumulate expression-related errors. | 2431 // accumulate expression-related errors. |
2432 productions |= ExpressionClassifier::ExpressionProduction | | 2432 productions |= ExpressionClassifier::ExpressionProductions | |
2433 ExpressionClassifier::TailCallExpressionProduction | | |
2434 ExpressionClassifier::ObjectLiteralProduction; | 2433 ExpressionClassifier::ObjectLiteralProduction; |
2435 } | 2434 } |
2436 | 2435 |
2437 classifier->Accumulate(&arrow_formals_classifier, productions, false); | 2436 classifier->Accumulate(&arrow_formals_classifier, productions, false); |
2438 | 2437 |
2439 if (!Token::IsAssignmentOp(peek())) { | 2438 if (!Token::IsAssignmentOp(peek())) { |
2440 // Parsed conditional expression only (no assignment). | 2439 // Parsed conditional expression only (no assignment). |
2441 // Now pending non-pattern expressions must be merged. | 2440 // Now pending non-pattern expressions must be merged. |
2442 classifier->MergeNonPatterns(&arrow_formals_classifier); | 2441 classifier->MergeNonPatterns(&arrow_formals_classifier); |
2443 return expression; | 2442 return expression; |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3725 has_seen_constructor_ = true; | 3724 has_seen_constructor_ = true; |
3726 return; | 3725 return; |
3727 } | 3726 } |
3728 } | 3727 } |
3729 | 3728 |
3730 | 3729 |
3731 } // namespace internal | 3730 } // namespace internal |
3732 } // namespace v8 | 3731 } // namespace v8 |
3733 | 3732 |
3734 #endif // V8_PARSING_PARSER_BASE_H | 3733 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |