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

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

Issue 469673002: Add union types to the analysis server API spec. (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/tool/spec/api.dart ('k') | pkg/analysis_server/tool/spec/codegen_java.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) 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 /** 5 /**
6 * Code generation for the file "integration_test_methods.dart". 6 * Code generation for the file "integration_test_methods.dart".
7 */ 7 */
8 library codegenInttestMethods; 8 library codegenInttestMethods;
9 9
10 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 case 'String': 226 case 'String':
227 case 'int': 227 case 'int':
228 case 'bool': 228 case 'bool':
229 // These types correspond exactly to Dart types 229 // These types correspond exactly to Dart types
230 return type.typeName; 230 return type.typeName;
231 case 'object': 231 case 'object':
232 return 'Map<String, dynamic>'; 232 return 'Map<String, dynamic>';
233 default: 233 default:
234 throw new Exception(type.typeName); 234 throw new Exception(type.typeName);
235 } 235 }
236 } else if (type is TypeUnion) {
237 return 'Object';
236 } else { 238 } else {
237 throw new Exception('Unexpected kind of TypeDecl'); 239 throw new Exception('Unexpected kind of TypeDecl');
238 } 240 }
239 } 241 }
240 } 242 }
241 243
242 /** 244 /**
243 * Translate spec_input.html into protocol_matchers.dart. 245 * Translate spec_input.html into protocol_matchers.dart.
244 */ 246 */
245 main() { 247 main() {
246 CodegenInttestMethodsVisitor visitor = new CodegenInttestMethodsVisitor( 248 CodegenInttestMethodsVisitor visitor = new CodegenInttestMethodsVisitor(
247 readApi()); 249 readApi());
248 String code = visitor.collectCode(visitor.visitApi); 250 String code = visitor.collectCode(visitor.visitApi);
249 File outputFile = new File( 251 File outputFile = new File(
250 '../../test/integration/integration_test_methods.dart'); 252 '../../test/integration/integration_test_methods.dart');
251 outputFile.writeAsStringSync(code); 253 outputFile.writeAsStringSync(code);
252 } 254 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/tool/spec/api.dart ('k') | pkg/analysis_server/tool/spec/codegen_java.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698