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

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

Issue 2710973002: Revert "Add support for the new function-type syntax." (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/compiler/lib/src/parser/diet_parser_task.dart ('k') | pkg/compiler/lib/src/parser/node_listener.dart » ('j') | no next file with comments »
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 48f3b8a17a9a98465b66a82831df3e81721f2b39..fba08ae848334263451c1c95191b7e5109e108d8 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -287,18 +287,10 @@ class ElementListener extends Listener {
}
@override
- void endFunctionTypeAlias(
- Token typedefKeyword, Token equals, Token endToken) {
- Identifier name;
- if (equals == null) {
- popNode(); // TODO(karlklose): do not throw away typeVariables.
- name = popNode();
- popNode(); // returnType
- } else {
- popNode(); // Function type.
- popNode(); // TODO(karlklose): do not throw away typeVariables.
- name = popNode();
- }
+ void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+ popNode(); // TODO(karlklose): do not throw away typeVariables.
+ Identifier name = popNode();
+ popNode(); // returnType
pushElement(new PartialTypedefElement(
name.source, compilationUnitElement, typedefKeyword, endToken));
rejectBuiltInIdentifier(name);
@@ -332,13 +324,13 @@ class ElementListener extends Listener {
@override
void endMixinApplication() {
NodeList mixins = popNode();
- NominalTypeAnnotation superclass = popNode();
+ TypeAnnotation superclass = popNode();
pushNode(new MixinApplication(superclass, mixins));
}
@override
void handleVoidKeyword(Token token) {
- pushNode(new NominalTypeAnnotation(new Identifier(token), null));
+ pushNode(new TypeAnnotation(new Identifier(token), null));
}
@override
@@ -411,7 +403,7 @@ class ElementListener extends Listener {
@override
void endTypeVariable(Token token, Token extendsOrSuper) {
- NominalTypeAnnotation bound = popNode();
+ TypeAnnotation bound = popNode();
Identifier name = popNode();
pushNode(new TypeVariable(name, extendsOrSuper, bound));
rejectBuiltInIdentifier(name);
@@ -438,21 +430,10 @@ class ElementListener extends Listener {
}
@override
- void handleType(Token beginToken, Token endToken) {
+ void endType(Token beginToken, Token endToken) {
NodeList typeArguments = popNode();
Expression typeName = popNode();
- pushNode(new NominalTypeAnnotation(typeName, typeArguments));
- }
-
- void handleNoName(Token token) {
- pushNode(null);
- }
-
- @override
- void handleFunctionType(Token functionToken, Token endToken) {
- popNode(); // Type parameters.
- popNode(); // Return type.
- pushNode(null);
+ pushNode(new TypeAnnotation(typeName, typeArguments));
}
@override
@@ -651,10 +632,6 @@ class ElementListener extends Listener {
errorCode = MessageKind.BAD_INPUT_CHARACTER;
break;
- case ErrorKind.InvalidInlineFunctionType:
- errorCode = MessageKind.INVALID_INLINE_FUNCTION_TYPE;
- break;
-
case ErrorKind.InvalidSyncModifier:
errorCode = MessageKind.INVALID_SYNC_MODIFIER;
break;
« no previous file with comments | « pkg/compiler/lib/src/parser/diet_parser_task.dart ('k') | pkg/compiler/lib/src/parser/node_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698