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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/diet_listener.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.diet_listener; 5 library fasta.diet_listener;
6 6
7 import 'package:kernel/ast.dart' show 7 import 'package:kernel/ast.dart' show
8 AsyncMarker; 8 AsyncMarker;
9 9
10 import 'package:kernel/class_hierarchy.dart' show 10 import 'package:kernel/class_hierarchy.dart' show
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void handleNoTypeArguments(Token token) { 126 void handleNoTypeArguments(Token token) {
127 debugEvent("NoTypeArguments"); 127 debugEvent("NoTypeArguments");
128 } 128 }
129 129
130 @override 130 @override
131 void handleNoType(Token token) { 131 void handleNoType(Token token) {
132 debugEvent("NoType"); 132 debugEvent("NoType");
133 } 133 }
134 134
135 @override 135 @override
136 void endType(Token beginToken, Token endToken) { 136 void handleType(Token beginToken, Token endToken) {
137 debugEvent("Type"); 137 debugEvent("Type");
138 discard(1); 138 discard(1);
139 } 139 }
140 140
141 @override 141 @override
142 void endTypeList(int count) { 142 void endTypeList(int count) {
143 debugEvent("TypeList"); 143 debugEvent("TypeList");
144 } 144 }
145 145
146 @override 146 @override
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 void handleNoFormalParameters(Token token) { 183 void handleNoFormalParameters(Token token) {
184 debugEvent("NoFormalParameters"); 184 debugEvent("NoFormalParameters");
185 if (identical(peek(), "-")) { 185 if (identical(peek(), "-")) {
186 pop(); 186 pop();
187 push("unary-"); 187 push("unary-");
188 } 188 }
189 push(token); 189 push(token);
190 } 190 }
191 191
192 @override 192 @override
193 void endFunctionTypeAlias(Token typedefKeyword, Token endToken) { 193 void endFunctionTypeAlias(
194 Token typedefKeyword, Token equals, Token endToken) {
194 debugEvent("FunctionTypeAlias"); 195 debugEvent("FunctionTypeAlias");
195 discard(2); // Name + endToken. 196 discard(2); // Name + endToken.
196 checkEmpty(typedefKeyword.charOffset); 197 checkEmpty(typedefKeyword.charOffset);
197 } 198 }
198 199
199 @override 200 @override
200 void endFields(int count, Token beginToken, Token endToken) { 201 void endFields(int count, Token beginToken, Token endToken) {
201 debugEvent("Fields"); 202 debugEvent("Fields");
202 List<String> names = popList(count); 203 List<String> names = popList(count);
203 Builder builder = lookupBuilder(beginToken, null, names.first); 204 Builder builder = lookupBuilder(beginToken, null, names.first);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 bool get isTargetingDartVm { 561 bool get isTargetingDartVm {
561 // TODO(ahe): Find a more reliable way to check if this is the Dart VM. 562 // TODO(ahe): Find a more reliable way to check if this is the Dart VM.
562 return coreTypes.getCoreLibrary("dart:_js_helper") == null; 563 return coreTypes.getCoreLibrary("dart:_js_helper") == null;
563 } 564 }
564 565
565 @override 566 @override
566 void debugEvent(String name) { 567 void debugEvent(String name) {
567 // printEvent(name); 568 // printEvent(name);
568 } 569 }
569 } 570 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698