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: { |
| 1293 if (!scope_->typed()) break; |
| 1294 int pos = peek_position(); |
| 1295 if (CheckContextualKeyword(CStrVector("type"))) { |
| 1296 return ParseTypeAliasDeclaration(pos, ok); |
| 1297 } |
| 1298 break; |
| 1299 } |
| 1300 // TODO(nikolaos): interface |
| 1301 // TODO(nikolaos): ambient |
1292 default: | 1302 default: |
1293 break; | 1303 break; |
1294 } | 1304 } |
1295 return ParseStatement(NULL, ok); | 1305 return ParseStatement(NULL, ok); |
1296 } | 1306 } |
1297 | 1307 |
1298 | 1308 |
1299 Statement* Parser::ParseModuleItem(bool* ok) { | 1309 Statement* Parser::ParseModuleItem(bool* ok) { |
1300 // (Ecma 262 6th Edition, 15.2): | 1310 // (Ecma 262 6th Edition, 15.2): |
1301 // ModuleItem : | 1311 // ModuleItem : |
(...skipping 5678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6980 try_block, target); | 6990 try_block, target); |
6981 final_loop = target; | 6991 final_loop = target; |
6982 } | 6992 } |
6983 | 6993 |
6984 return final_loop; | 6994 return final_loop; |
6985 } | 6995 } |
6986 | 6996 |
6987 | 6997 |
6988 } // namespace internal | 6998 } // namespace internal |
6989 } // namespace v8 | 6999 } // namespace v8 |
OLD | NEW |