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'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 */ | 28 */ |
29 final ToHtmlVisitor toHtmlVisitor; | 29 final ToHtmlVisitor toHtmlVisitor; |
30 | 30 |
31 /** | 31 /** |
32 * Short human-readable string describing the context of the matcher being | 32 * Short human-readable string describing the context of the matcher being |
33 * created. | 33 * created. |
34 */ | 34 */ |
35 String context; | 35 String context; |
36 | 36 |
37 CodegenMatchersVisitor(Api api) | 37 CodegenMatchersVisitor(Api api) |
38 : super(api), | 38 : toHtmlVisitor = new ToHtmlVisitor(api), |
39 toHtmlVisitor = new ToHtmlVisitor(api) { | 39 super(api) { |
40 codeGeneratorSettings.commentLineLength = 79; | 40 codeGeneratorSettings.commentLineLength = 79; |
41 codeGeneratorSettings.languageName = 'dart'; | 41 codeGeneratorSettings.languageName = 'dart'; |
42 } | 42 } |
43 | 43 |
44 /** | 44 /** |
45 * Create a matcher for the part of the API called [name], optionally | 45 * Create a matcher for the part of the API called [name], optionally |
46 * clarified by [nameSuffix]. The matcher should verify that its input | 46 * clarified by [nameSuffix]. The matcher should verify that its input |
47 * matches the given [type]. | 47 * matches the given [type]. |
48 */ | 48 */ |
49 void makeMatcher(ImpliedType impliedType) { | 49 void makeMatcher(ImpliedType impliedType) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 for (TypeDecl choice in typeUnion.choices) { | 183 for (TypeDecl choice in typeUnion.choices) { |
184 if (commaNeeded) { | 184 if (commaNeeded) { |
185 write(', '); | 185 write(', '); |
186 } | 186 } |
187 visitTypeDecl(choice); | 187 visitTypeDecl(choice); |
188 commaNeeded = true; | 188 commaNeeded = true; |
189 } | 189 } |
190 write('])'); | 190 write('])'); |
191 } | 191 } |
192 } | 192 } |
OLD | NEW |