| 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_PREPARSER_H | 5 #ifndef V8_PREPARSER_H |
| 6 #define V8_PREPARSER_H | 6 #define V8_PREPARSER_H |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 // ArrayLiteral :: | 2006 // ArrayLiteral :: |
| 2007 // '[' Expression? (',' Expression?)* ']' | 2007 // '[' Expression? (',' Expression?)* ']' |
| 2008 | 2008 |
| 2009 int pos = peek_position(); | 2009 int pos = peek_position(); |
| 2010 typename Traits::Type::ExpressionList values = | 2010 typename Traits::Type::ExpressionList values = |
| 2011 this->NewExpressionList(4, zone_); | 2011 this->NewExpressionList(4, zone_); |
| 2012 Expect(Token::LBRACK, CHECK_OK); | 2012 Expect(Token::LBRACK, CHECK_OK); |
| 2013 while (peek() != Token::RBRACK) { | 2013 while (peek() != Token::RBRACK) { |
| 2014 ExpressionT elem = this->EmptyExpression(); | 2014 ExpressionT elem = this->EmptyExpression(); |
| 2015 if (peek() == Token::COMMA) { | 2015 if (peek() == Token::COMMA) { |
| 2016 if (is_strong(language_mode())) { |
| 2017 ReportMessageAt(scanner()->peek_location(), "strong_ellision"); |
| 2018 *ok = false; |
| 2019 return this->EmptyExpression(); |
| 2020 } |
| 2016 elem = this->GetLiteralTheHole(peek_position(), factory()); | 2021 elem = this->GetLiteralTheHole(peek_position(), factory()); |
| 2017 } else { | 2022 } else { |
| 2018 elem = this->ParseAssignmentExpression(true, CHECK_OK); | 2023 elem = this->ParseAssignmentExpression(true, CHECK_OK); |
| 2019 } | 2024 } |
| 2020 values->Add(elem, zone_); | 2025 values->Add(elem, zone_); |
| 2021 if (peek() != Token::RBRACK) { | 2026 if (peek() != Token::RBRACK) { |
| 2022 Expect(Token::COMMA, CHECK_OK); | 2027 Expect(Token::COMMA, CHECK_OK); |
| 2023 } | 2028 } |
| 2024 } | 2029 } |
| 2025 Expect(Token::RBRACK, CHECK_OK); | 2030 Expect(Token::RBRACK, CHECK_OK); |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3104 *ok = false; | 3109 *ok = false; |
| 3105 return; | 3110 return; |
| 3106 } | 3111 } |
| 3107 has_seen_constructor_ = true; | 3112 has_seen_constructor_ = true; |
| 3108 return; | 3113 return; |
| 3109 } | 3114 } |
| 3110 } | 3115 } |
| 3111 } } // v8::internal | 3116 } } // v8::internal |
| 3112 | 3117 |
| 3113 #endif // V8_PREPARSER_H | 3118 #endif // V8_PREPARSER_H |
| OLD | NEW |