Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Side by Side Diff: src/parsing/parser.cc

Issue 1839393002: Add parsing for type aliases (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types-1841093002-fun-decl
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698