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

Unified Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fix comments. Created 4 years 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 | « no previous file | pkg/compiler/lib/src/parser/listener.dart » ('j') | pkg/compiler/lib/src/parser/parser.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/element_listener.dart
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index 5c058ee73318ec6827dc3b4f96811f6d2f68c51e..1abf7c38c8d0529cadeccde114dafa2fb8d0d48c 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -269,6 +269,15 @@ class ElementListener extends Listener {
rejectBuiltInIdentifier(name);
}
+ void endNewFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+ popNode(); // Function type.
+ popNode(); // TODO(karlklose): do not throw away typeVariables.
+ Identifier name = popNode();
+ pushElement(new PartialTypedefElement(
+ name.source, compilationUnitElement, typedefKeyword, endToken));
+ rejectBuiltInIdentifier(name);
+ }
+
void endNamedMixinApplication(
Token classKeyword, Token implementsKeyword, Token endToken) {
NodeList interfaces = (implementsKeyword != null) ? popNode() : null;
@@ -394,6 +403,12 @@ class ElementListener extends Listener {
pushNode(new TypeAnnotation(typeName, typeArguments));
}
+ void endFunctionType(Token beginToken, Token endToken) {
+ popNode(); // Type parameters.
+ popNode(); // Return type.
+ pushNode(null);
+ }
+
void handleParenthesizedExpression(BeginGroupToken token) {
Expression expression = popNode();
pushNode(new ParenthesizedExpression(expression, token));
« no previous file with comments | « no previous file | pkg/compiler/lib/src/parser/listener.dart » ('j') | pkg/compiler/lib/src/parser/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698