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 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2609 if (expression->IsFunctionLiteral() && mode() == PARSE_EAGERLY) { | 2609 if (expression->IsFunctionLiteral() && mode() == PARSE_EAGERLY) { |
2610 // If the tag function looks like an IIFE, set_parenthesized() to | 2610 // If the tag function looks like an IIFE, set_parenthesized() to |
2611 // force eager compilation. | 2611 // force eager compilation. |
2612 expression->AsFunctionLiteral()->set_should_eager_compile(); | 2612 expression->AsFunctionLiteral()->set_should_eager_compile(); |
2613 } | 2613 } |
2614 } | 2614 } |
2615 expression = | 2615 expression = |
2616 ParseTemplateLiteral(expression, pos, classifier, CHECK_OK); | 2616 ParseTemplateLiteral(expression, pos, classifier, CHECK_OK); |
2617 break; | 2617 break; |
2618 } | 2618 } |
| 2619 case Token::ILLEGAL: { |
| 2620 ReportUnexpectedTokenAt(scanner()->peek_location(), Token::ILLEGAL); |
| 2621 *ok = false; |
| 2622 return this->EmptyExpression(); |
| 2623 } |
2619 default: | 2624 default: |
2620 return expression; | 2625 return expression; |
2621 } | 2626 } |
2622 } | 2627 } |
2623 DCHECK(false); | 2628 DCHECK(false); |
2624 return this->EmptyExpression(); | 2629 return this->EmptyExpression(); |
2625 } | 2630 } |
2626 | 2631 |
2627 | 2632 |
2628 template <class Traits> | 2633 template <class Traits> |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3082 has_seen_constructor_ = true; | 3087 has_seen_constructor_ = true; |
3083 return; | 3088 return; |
3084 } | 3089 } |
3085 } | 3090 } |
3086 | 3091 |
3087 | 3092 |
3088 } // namespace internal | 3093 } // namespace internal |
3089 } // namespace v8 | 3094 } // namespace v8 |
3090 | 3095 |
3091 #endif // V8_PARSING_PARSER_BASE_H | 3096 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |