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

Side by Side Diff: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart

Issue 495623002: Don't use "final" in analysis server protocol classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 codegen.protocol; 5 library codegen.protocol;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'api.dart'; 9 import 'api.dart';
10 import 'codegen_tools.dart'; 10 import 'codegen_tools.dart';
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 })); 232 }));
233 writeln('class $className implements HasToJson {'); 233 writeln('class $className implements HasToJson {');
234 indent(() { 234 indent(() {
235 for (TypeObjectField field in type.fields) { 235 for (TypeObjectField field in type.fields) {
236 if (field.value != null) { 236 if (field.value != null) {
237 continue; 237 continue;
238 } 238 }
239 docComment(toHtmlVisitor.collectHtml(() { 239 docComment(toHtmlVisitor.collectHtml(() {
240 toHtmlVisitor.translateHtml(field.html); 240 toHtmlVisitor.translateHtml(field.html);
241 })); 241 }));
242 writeln('final ${dartType(field.type)} ${field.name};'); 242 writeln('${dartType(field.type)} ${field.name};');
243 writeln(); 243 writeln();
244 } 244 }
245 emitObjectConstructor(type, className); 245 emitObjectConstructor(type, className);
246 writeln(); 246 writeln();
247 emitObjectFromJsonConstructor(className, type, impliedType); 247 emitObjectFromJsonConstructor(className, type, impliedType);
248 writeln(); 248 writeln();
249 if (emitConvenienceConstructor(className, impliedType)) { 249 if (emitConvenienceConstructor(className, impliedType)) {
250 writeln(); 250 writeln();
251 } 251 }
252 emitToJsonMember(type); 252 emitToJsonMember(type);
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi()); 828 CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi());
829 return visitor.collectCode(visitor.visitApi); 829 return visitor.collectCode(visitor.visitApi);
830 }); 830 });
831 831
832 /** 832 /**
833 * Translate spec_input.html into protocol_matchers.dart. 833 * Translate spec_input.html into protocol_matchers.dart.
834 */ 834 */
835 main() { 835 main() {
836 target.generate(); 836 target.generate();
837 } 837 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698