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

Side by Side Diff: pkg/analyzer/lib/src/kernel/ast_from_analyzer.dart

Issue 2997593002: Replace comment style generic method syntax with real syntax (TBR) (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library kernel.analyzer.ast_from_analyzer; 4 library kernel.analyzer.ast_from_analyzer;
5 5
6 import 'package:kernel/ast.dart' as ast; 6 import 'package:kernel/ast.dart' as ast;
7 import 'package:kernel/frontend/super_initializers.dart'; 7 import 'package:kernel/frontend/super_initializers.dart';
8 import 'package:kernel/log.dart'; 8 import 'package:kernel/log.dart';
9 import 'package:kernel/type_algebra.dart'; 9 import 'package:kernel/type_algebra.dart';
10 import 'package:kernel/transformations/flags.dart'; 10 import 'package:kernel/transformations/flags.dart';
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 } else if (type.isVoid) { 2291 } else if (type.isVoid) {
2292 return const ast.VoidType(); 2292 return const ast.VoidType();
2293 } else if (type.isDynamic) { 2293 } else if (type.isDynamic) {
2294 return const ast.DynamicType(); 2294 return const ast.DynamicType();
2295 } else { 2295 } else {
2296 log.severe('Unexpected DartType: $type'); 2296 log.severe('Unexpected DartType: $type');
2297 return const ast.InvalidType(); 2297 return const ast.InvalidType();
2298 } 2298 }
2299 } 2299 }
2300 2300
2301 static Iterable/*<E>*/ concatenate/*<E>*/( 2301 static Iterable<E> concatenate<E>(Iterable<E> x, Iterable<E> y) =>
2302 Iterable/*<E>*/ x, Iterable/*<E>*/ y) => 2302 <Iterable<E>>[x, y].expand((z) => z);
2303 <Iterable<dynamic/*=E*/ >>[x, y].expand((z) => z);
2304 2303
2305 ast.TypeParameter convertTypeParameter(TypeParameterElement typeParameter, 2304 ast.TypeParameter convertTypeParameter(TypeParameterElement typeParameter,
2306 List<TypeParameterElement> boundVariables) { 2305 List<TypeParameterElement> boundVariables) {
2307 return scope.makeTypeParameter(typeParameter, 2306 return scope.makeTypeParameter(typeParameter,
2308 bound: typeParameter.bound == null 2307 bound: typeParameter.bound == null
2309 ? scope.defaultTypeParameterBound 2308 ? scope.defaultTypeParameterBound
2310 : convertType(typeParameter.bound, boundVariables)); 2309 : convertType(typeParameter.bound, boundVariables));
2311 } 2310 }
2312 2311
2313 List<ast.TypeParameter> convertTypeParameterList( 2312 List<ast.TypeParameter> convertTypeParameterList(
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
3072 return element; 3071 return element;
3073 } 3072 }
3074 3073
3075 Element desynthesizeSetter(Element element) { 3074 Element desynthesizeSetter(Element element) {
3076 if (element == null || !element.isSynthetic) return element; 3075 if (element == null || !element.isSynthetic) return element;
3077 if (element is PropertyAccessorElement) return element.variable; 3076 if (element is PropertyAccessorElement) return element.variable;
3078 if (element is FieldElement) return element.setter; 3077 if (element is FieldElement) return element.setter;
3079 return element; 3078 return element;
3080 } 3079 }
3081 3080
3082 void sortAndRemoveDuplicates/*<T extends Comparable<T>>*/(List/*<T>*/ list) { 3081 void sortAndRemoveDuplicates<T extends Comparable<T>>(List<T> list) {
3083 list.sort(); 3082 list.sort();
3084 int deleted = 0; 3083 int deleted = 0;
3085 for (int i = 1; i < list.length; ++i) { 3084 for (int i = 1; i < list.length; ++i) {
3086 var item = list[i]; 3085 var item = list[i];
3087 if (list[i - 1].compareTo(item) == 0) { 3086 if (list[i - 1].compareTo(item) == 0) {
3088 ++deleted; 3087 ++deleted;
3089 } else if (deleted > 0) { 3088 } else if (deleted > 0) {
3090 list[i - deleted] = item; 3089 list[i - deleted] = item;
3091 } 3090 }
3092 } 3091 }
3093 if (deleted > 0) { 3092 if (deleted > 0) {
3094 list.length -= deleted; 3093 list.length -= deleted;
3095 } 3094 }
3096 } 3095 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698