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

Unified 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: More tests and allow type as an indentifier 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index a2c6f22e4e0696f7ac1087ca43b12f44acf43580..871bf7bb1ad25880cdc78aff0947d56fa8dbbba2 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1289,6 +1289,18 @@ Statement* Parser::ParseStatementListItem(bool* ok) {
return ParseVariableStatement(kStatementListItem, NULL, ok);
}
break;
+ case Token::IDENTIFIER: {
+ if (!scope_->typed()) break;
+ int pos = peek_position();
+ if (PeekContextualKeyword(CStrVector("type")) &&
+ PeekAhead() == Token::IDENTIFIER) {
+ Consume(Token::IDENTIFIER);
+ return ParseTypeAliasDeclaration(pos, ok);
+ }
+ break;
+ }
+ // TODO(nikolaos): interface
+ // TODO(nikolaos): ambient
default:
break;
}
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698