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 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 | 2381 |
2382 if (this->IsValidReferenceExpression(expression)) { | 2382 if (this->IsValidReferenceExpression(expression)) { |
2383 arrow_formals_classifier.ForgiveAssignmentPatternError(); | 2383 arrow_formals_classifier.ForgiveAssignmentPatternError(); |
2384 } | 2384 } |
2385 | 2385 |
2386 // "expression" was not itself an arrow function parameter list, but it might | 2386 // "expression" was not itself an arrow function parameter list, but it might |
2387 // form part of one. Propagate speculative formal parameter error locations. | 2387 // form part of one. Propagate speculative formal parameter error locations. |
2388 // Do not merge pending non-pattern expressions yet! | 2388 // Do not merge pending non-pattern expressions yet! |
2389 classifier->Accumulate( | 2389 classifier->Accumulate( |
2390 &arrow_formals_classifier, | 2390 &arrow_formals_classifier, |
2391 ExpressionClassifier::StandardProductions | | 2391 ExpressionClassifier::ExpressionProductions | |
| 2392 ExpressionClassifier::PatternProductions | |
2392 ExpressionClassifier::FormalParametersProductions | | 2393 ExpressionClassifier::FormalParametersProductions | |
2393 ExpressionClassifier::CoverInitializedNameProduction | | 2394 ExpressionClassifier::CoverInitializedNameProduction | |
2394 ExpressionClassifier::AsyncArrowFormalParametersProduction | | 2395 ExpressionClassifier::AsyncArrowFormalParametersProduction, |
2395 ExpressionClassifier::AsyncBindingPatternProduction, | |
2396 false); | 2396 false); |
2397 | 2397 |
2398 if (!Token::IsAssignmentOp(peek())) { | 2398 if (!Token::IsAssignmentOp(peek())) { |
2399 // Parsed conditional expression only (no assignment). | 2399 // Parsed conditional expression only (no assignment). |
2400 // Now pending non-pattern expressions must be merged. | 2400 // Now pending non-pattern expressions must be merged. |
2401 classifier->MergeNonPatterns(&arrow_formals_classifier); | 2401 classifier->MergeNonPatterns(&arrow_formals_classifier); |
2402 return expression; | 2402 return expression; |
2403 } | 2403 } |
2404 | 2404 |
2405 // Now pending non-pattern expressions must be discarded. | 2405 // Now pending non-pattern expressions must be discarded. |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3728 has_seen_constructor_ = true; | 3728 has_seen_constructor_ = true; |
3729 return; | 3729 return; |
3730 } | 3730 } |
3731 } | 3731 } |
3732 | 3732 |
3733 | 3733 |
3734 } // namespace internal | 3734 } // namespace internal |
3735 } // namespace v8 | 3735 } // namespace v8 |
3736 | 3736 |
3737 #endif // V8_PARSING_PARSER_BASE_H | 3737 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |