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

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: Created 4 years, 9 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
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index a2c6f22e4e0696f7ac1087ca43b12f44acf43580..8af7f22ae96ca7e6f56877059d616f1e959f428e 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1289,6 +1289,16 @@ Statement* Parser::ParseStatementListItem(bool* ok) {
return ParseVariableStatement(kStatementListItem, NULL, ok);
}
break;
+ case Token::IDENTIFIER: {
+ if (!scope_->typed()) break;
+ int pos = peek_position();
+ if (CheckContextualKeyword(CStrVector("type"))) {
+ 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') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698