Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
| 8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
| 9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 case Token::CONST: | 195 case Token::CONST: |
| 196 if (allow_const()) { | 196 if (allow_const()) { |
| 197 return ParseVariableStatement(kStatementListItem, ok); | 197 return ParseVariableStatement(kStatementListItem, ok); |
| 198 } | 198 } |
| 199 break; | 199 break; |
| 200 case Token::LET: | 200 case Token::LET: |
| 201 if (IsNextLetKeyword()) { | 201 if (IsNextLetKeyword()) { |
| 202 return ParseVariableStatement(kStatementListItem, ok); | 202 return ParseVariableStatement(kStatementListItem, ok); |
| 203 } | 203 } |
| 204 break; | 204 break; |
| 205 case Token::IDENTIFIER: | |
| 206 CheckNextEscapedKeyword(ok); | |
|
adamk
2015/11/03 23:00:57
Same here, CHECK_OK and break.
caitp (gmail)
2015/11/04 04:49:24
Done.
| |
| 207 if (!*ok) return Statement::Default(); | |
| 205 default: | 208 default: |
| 206 break; | 209 break; |
| 207 } | 210 } |
| 208 return ParseStatement(ok); | 211 return ParseStatement(ok); |
| 209 } | 212 } |
| 210 | 213 |
| 211 | 214 |
| 212 void PreParser::ParseStatementList(int end_token, bool* ok, | 215 void PreParser::ParseStatementList(int end_token, bool* ok, |
| 213 Scanner::BookmarkScope* bookmark) { | 216 Scanner::BookmarkScope* bookmark) { |
| 214 // SourceElements :: | 217 // SourceElements :: |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1254 Expect(Token::RBRACE, CHECK_OK); | 1257 Expect(Token::RBRACE, CHECK_OK); |
| 1255 return PreParserExpression::Default(); | 1258 return PreParserExpression::Default(); |
| 1256 } | 1259 } |
| 1257 } | 1260 } |
| 1258 | 1261 |
| 1259 #undef CHECK_OK | 1262 #undef CHECK_OK |
| 1260 | 1263 |
| 1261 | 1264 |
| 1262 } // namespace internal | 1265 } // namespace internal |
| 1263 } // namespace v8 | 1266 } // namespace v8 |
| OLD | NEW |