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/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 classifier->RecordAsyncArrowFormalParametersError( | 2663 classifier->RecordAsyncArrowFormalParametersError( |
2664 Scanner::Location(beg_pos, scanner()->location().end_pos), | 2664 Scanner::Location(beg_pos, scanner()->location().end_pos), |
2665 MessageTemplate::kAwaitBindingIdentifier); | 2665 MessageTemplate::kAwaitBindingIdentifier); |
2666 | 2666 |
2667 return this->ExpressionFromIdentifier( | 2667 return this->ExpressionFromIdentifier( |
2668 name, beg_pos, scanner()->location().end_pos, scope_, factory()); | 2668 name, beg_pos, scanner()->location().end_pos, scope_, factory()); |
2669 } | 2669 } |
2670 default: | 2670 default: |
2671 break; | 2671 break; |
2672 } | 2672 } |
| 2673 |
| 2674 int await_pos = peek_position(); |
2673 Consume(Token::AWAIT); | 2675 Consume(Token::AWAIT); |
2674 | 2676 |
2675 ExpressionT value = ParseUnaryExpression(classifier, CHECK_OK); | 2677 ExpressionT value = ParseUnaryExpression(classifier, CHECK_OK); |
2676 | 2678 |
2677 classifier->RecordFormalParameterInitializerError( | 2679 classifier->RecordFormalParameterInitializerError( |
2678 Scanner::Location(beg_pos, scanner()->location().end_pos), | 2680 Scanner::Location(beg_pos, scanner()->location().end_pos), |
2679 MessageTemplate::kAwaitExpressionFormalParameter); | 2681 MessageTemplate::kAwaitExpressionFormalParameter); |
2680 return Traits::RewriteAwaitExpression(value, beg_pos); | 2682 return Traits::RewriteAwaitExpression(value, await_pos); |
2681 } else { | 2683 } else { |
2682 return this->ParsePostfixExpression(classifier, ok); | 2684 return this->ParsePostfixExpression(classifier, ok); |
2683 } | 2685 } |
2684 } | 2686 } |
2685 | 2687 |
2686 | 2688 |
2687 template <class Traits> | 2689 template <class Traits> |
2688 typename ParserBase<Traits>::ExpressionT | 2690 typename ParserBase<Traits>::ExpressionT |
2689 ParserBase<Traits>::ParsePostfixExpression(ExpressionClassifier* classifier, | 2691 ParserBase<Traits>::ParsePostfixExpression(ExpressionClassifier* classifier, |
2690 bool* ok) { | 2692 bool* ok) { |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3596 has_seen_constructor_ = true; | 3598 has_seen_constructor_ = true; |
3597 return; | 3599 return; |
3598 } | 3600 } |
3599 } | 3601 } |
3600 | 3602 |
3601 | 3603 |
3602 } // namespace internal | 3604 } // namespace internal |
3603 } // namespace v8 | 3605 } // namespace v8 |
3604 | 3606 |
3605 #endif // V8_PARSING_PARSER_BASE_H | 3607 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |