| 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 library codegen.protocol; | 5 library codegen.protocol; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/codegen/tools.dart'; | 9 import 'package:analyzer/src/codegen/tools.dart'; |
| 10 import 'package:html/dom.dart' as dom; | 10 import 'package:html/dom.dart' as dom; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 indent(() { | 253 indent(() { |
| 254 if (emitSpecialStaticMembers(className)) { | 254 if (emitSpecialStaticMembers(className)) { |
| 255 writeln(); | 255 writeln(); |
| 256 } | 256 } |
| 257 for (TypeEnumValue value in type.values) { | 257 for (TypeEnumValue value in type.values) { |
| 258 docComment(toHtmlVisitor.collectHtml(() { | 258 docComment(toHtmlVisitor.collectHtml(() { |
| 259 toHtmlVisitor.translateHtml(value.html); | 259 toHtmlVisitor.translateHtml(value.html); |
| 260 })); | 260 })); |
| 261 String valueString = literalString(value.value); | 261 String valueString = literalString(value.value); |
| 262 writeln( | 262 writeln( |
| 263 'static const ${value.value} = const $className._($valueString);'); | 263 'static const $className ${value.value} = const $className._($valueS
tring);'); |
| 264 writeln(); | 264 writeln(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 writeln('/**'); | 267 writeln('/**'); |
| 268 writeln(' * A list containing all of the enum values that are defined.'); | 268 writeln(' * A list containing all of the enum values that are defined.'); |
| 269 writeln(' */'); | 269 writeln(' */'); |
| 270 write('static const List<'); | 270 write('static const List<'); |
| 271 write(className); | 271 write(className); |
| 272 write('> VALUES = const <'); | 272 write('> VALUES = const <'); |
| 273 write(className); | 273 write(className); |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 | 1233 |
| 1234 @override | 1234 @override |
| 1235 String get asClosure => '($type value) => ${callback('value')}'; | 1235 String get asClosure => '($type value) => ${callback('value')}'; |
| 1236 | 1236 |
| 1237 @override | 1237 @override |
| 1238 bool get isIdentity => false; | 1238 bool get isIdentity => false; |
| 1239 | 1239 |
| 1240 @override | 1240 @override |
| 1241 String asSnippet(String value) => callback(value); | 1241 String asSnippet(String value) => callback(value); |
| 1242 } | 1242 } |
| OLD | NEW |