| 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/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2715 // assignment pattern errors if the parsed expression is more complex. | 2715 // assignment pattern errors if the parsed expression is more complex. |
| 2716 if (IsValidReferenceExpression(expression)) { | 2716 if (IsValidReferenceExpression(expression)) { |
| 2717 productions &= ~ExpressionClassifier::AssignmentPatternProduction; | 2717 productions &= ~ExpressionClassifier::AssignmentPatternProduction; |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 const bool is_destructuring_assignment = | 2720 const bool is_destructuring_assignment = |
| 2721 IsValidPattern(expression) && peek() == Token::ASSIGN; | 2721 IsValidPattern(expression) && peek() == Token::ASSIGN; |
| 2722 if (is_destructuring_assignment) { | 2722 if (is_destructuring_assignment) { |
| 2723 // This is definitely not an expression so don't accumulate | 2723 // This is definitely not an expression so don't accumulate |
| 2724 // expression-related errors. | 2724 // expression-related errors. |
| 2725 productions &= ~(ExpressionClassifier::ExpressionProduction | | 2725 productions &= ~ExpressionClassifier::ExpressionProduction; |
| 2726 ExpressionClassifier::TailCallExpressionProduction); | |
| 2727 } | 2726 } |
| 2728 | 2727 |
| 2729 if (!Token::IsAssignmentOp(peek())) { | 2728 if (!Token::IsAssignmentOp(peek())) { |
| 2730 // Parsed conditional expression only (no assignment). | 2729 // Parsed conditional expression only (no assignment). |
| 2731 // Pending non-pattern expressions must be merged. | 2730 // Pending non-pattern expressions must be merged. |
| 2732 impl()->Accumulate(productions); | 2731 impl()->Accumulate(productions); |
| 2733 return expression; | 2732 return expression; |
| 2734 } else { | 2733 } else { |
| 2735 // Pending non-pattern expressions must be discarded. | 2734 // Pending non-pattern expressions must be discarded. |
| 2736 impl()->Accumulate(productions, false); | 2735 impl()->Accumulate(productions, false); |
| (...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5455 has_seen_constructor_ = true; | 5454 has_seen_constructor_ = true; |
| 5456 return; | 5455 return; |
| 5457 } | 5456 } |
| 5458 } | 5457 } |
| 5459 | 5458 |
| 5460 | 5459 |
| 5461 } // namespace internal | 5460 } // namespace internal |
| 5462 } // namespace v8 | 5461 } // namespace v8 |
| 5463 | 5462 |
| 5464 #endif // V8_PARSING_PARSER_BASE_H | 5463 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |