| 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 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
| 10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 return ParseVariableStatement(kStatementListItem, NULL, ok); | 1282 return ParseVariableStatement(kStatementListItem, NULL, ok); |
| 1283 } | 1283 } |
| 1284 break; | 1284 break; |
| 1285 case Token::VAR: | 1285 case Token::VAR: |
| 1286 return ParseVariableStatement(kStatementListItem, NULL, ok); | 1286 return ParseVariableStatement(kStatementListItem, NULL, ok); |
| 1287 case Token::LET: | 1287 case Token::LET: |
| 1288 if (IsNextLetKeyword()) { | 1288 if (IsNextLetKeyword()) { |
| 1289 return ParseVariableStatement(kStatementListItem, NULL, ok); | 1289 return ParseVariableStatement(kStatementListItem, NULL, ok); |
| 1290 } | 1290 } |
| 1291 break; | 1291 break; |
| 1292 case Token::IDENTIFIER: { | 1292 case Token::IDENTIFIER: |
| 1293 case Token::FUTURE_STRICT_RESERVED_WORD: { |
| 1293 if (!scope_->typed()) break; | 1294 if (!scope_->typed()) break; |
| 1294 int pos = peek_position(); | 1295 int pos = peek_position(); |
| 1295 if (CheckContextualKeyword(CStrVector("type"))) { | 1296 if (CheckContextualKeyword(CStrVector("type"))) { |
| 1296 return ParseTypeAliasDeclaration(pos, ok); | 1297 return ParseTypeAliasDeclaration(pos, ok); |
| 1298 } else if (CheckContextualKeyword(CStrVector("interface"))) { |
| 1299 return ParseInterfaceDeclaration(pos, ok); |
| 1297 } | 1300 } |
| 1298 break; | 1301 break; |
| 1299 } | 1302 } |
| 1300 // TODO(nikolaos): interface | |
| 1301 // TODO(nikolaos): ambient | 1303 // TODO(nikolaos): ambient |
| 1302 default: | 1304 default: |
| 1303 break; | 1305 break; |
| 1304 } | 1306 } |
| 1305 return ParseStatement(NULL, ok); | 1307 return ParseStatement(NULL, ok); |
| 1306 } | 1308 } |
| 1307 | 1309 |
| 1308 | 1310 |
| 1309 Statement* Parser::ParseModuleItem(bool* ok) { | 1311 Statement* Parser::ParseModuleItem(bool* ok) { |
| 1310 // (Ecma 262 6th Edition, 15.2): | 1312 // (Ecma 262 6th Edition, 15.2): |
| (...skipping 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7022 try_block, target); | 7024 try_block, target); |
| 7023 final_loop = target; | 7025 final_loop = target; |
| 7024 } | 7026 } |
| 7025 | 7027 |
| 7026 return final_loop; | 7028 return final_loop; |
| 7027 } | 7029 } |
| 7028 | 7030 |
| 7029 | 7031 |
| 7030 } // namespace internal | 7032 } // namespace internal |
| 7031 } // namespace v8 | 7033 } // namespace v8 |
| OLD | NEW |