| 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 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/codegen/tools.dart'; | 10 import 'package:analyzer/src/codegen/tools.dart'; |
| 11 | 11 |
| 12 import 'api.dart'; | 12 import 'api.dart'; |
| 13 import 'from_html.dart'; | 13 import 'from_html.dart'; |
| 14 import 'implied_types.dart'; | 14 import 'implied_types.dart'; |
| 15 import 'to_html.dart'; | 15 import 'to_html.dart'; |
| 16 | 16 |
| 17 final GeneratedFile target = new GeneratedFile( | 17 final GeneratedFile target = new GeneratedFile( |
| 18 'test/integration/support/protocol_matchers.dart', (String pkgPath) { | 18 'test/integration/support/protocol_matchers.dart', (String pkgPath) async { |
| 19 CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi(pkgPath)); | 19 CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi(pkgPath)); |
| 20 return visitor.collectCode(visitor.visitApi); | 20 return visitor.collectCode(visitor.visitApi); |
| 21 }); | 21 }); |
| 22 | 22 |
| 23 class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { | 23 class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { |
| 24 /** | 24 /** |
| 25 * Visitor used to produce doc comments. | 25 * Visitor used to produce doc comments. |
| 26 */ | 26 */ |
| 27 final ToHtmlVisitor toHtmlVisitor; | 27 final ToHtmlVisitor toHtmlVisitor; |
| 28 | 28 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 for (TypeDecl choice in typeUnion.choices) { | 181 for (TypeDecl choice in typeUnion.choices) { |
| 182 if (commaNeeded) { | 182 if (commaNeeded) { |
| 183 write(', '); | 183 write(', '); |
| 184 } | 184 } |
| 185 visitTypeDecl(choice); | 185 visitTypeDecl(choice); |
| 186 commaNeeded = true; | 186 commaNeeded = true; |
| 187 } | 187 } |
| 188 write('])'); | 188 write('])'); |
| 189 } | 189 } |
| 190 } | 190 } |
| OLD | NEW |