OLD | NEW |
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 "matchers.dart". | 6 * Code generation for the file "matchers.dart". |
7 */ | 7 */ |
8 library codegen.matchers; | 8 library codegen.matchers; |
9 | 9 |
10 import 'dart:convert'; | 10 import 'dart:convert'; |
11 | 11 |
12 import 'api.dart'; | 12 import 'api.dart'; |
13 import 'codegen_tools.dart'; | 13 import 'codegen_tools.dart'; |
14 import 'from_html.dart'; | 14 import 'from_html.dart'; |
15 import 'implied_types.dart'; | 15 import 'implied_types.dart'; |
16 import 'to_html.dart'; | 16 import 'to_html.dart'; |
17 | 17 |
18 final GeneratedFile target = new GeneratedFile( | 18 final GeneratedFile target = |
19 '../../test/integration/protocol_matchers.dart', () { | 19 new GeneratedFile('../../test/integration/protocol_matchers.dart', () { |
20 CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi()); | 20 CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi()); |
21 return visitor.collectCode(visitor.visitApi); | 21 return visitor.collectCode(visitor.visitApi); |
22 }); | 22 }); |
23 | 23 |
24 /** | 24 /** |
25 * Translate spec_input.html into protocol_matchers.dart. | 25 * Translate spec_input.html into protocol_matchers.dart. |
26 */ | 26 */ |
27 main() { | 27 main() { |
28 target.generate(); | 28 target.generate(); |
29 } | 29 } |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 for (TypeDecl choice in typeUnion.choices) { | 189 for (TypeDecl choice in typeUnion.choices) { |
190 if (commaNeeded) { | 190 if (commaNeeded) { |
191 write(', '); | 191 write(', '); |
192 } | 192 } |
193 visitTypeDecl(choice); | 193 visitTypeDecl(choice); |
194 commaNeeded = true; | 194 commaNeeded = true; |
195 } | 195 } |
196 write('])'); | 196 write('])'); |
197 } | 197 } |
198 } | 198 } |
OLD | NEW |