| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analysis_server.src.status.ast_writer; | 5 library analysis_server.src.status.ast_writer; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/status/utilities.dart'; | 7 import 'dart:convert'; |
| 8 |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 9 | 10 |
| 10 /** | 11 /** |
| 11 * A visitor that will produce an HTML representation of an AST structure. | 12 * A visitor that will produce an HTML representation of an AST structure. |
| 12 */ | 13 */ |
| 13 class AstWriter extends UnifyingAstVisitor { | 14 class AstWriter extends UnifyingAstVisitor { |
| 14 /** | 15 /** |
| 15 * The buffer on which the HTML is to be written. | 16 * The buffer on which the HTML is to be written. |
| 16 */ | 17 */ |
| 17 final StringBuffer buffer; | 18 final StringBuffer buffer; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 169 } |
| 169 } | 170 } |
| 170 | 171 |
| 171 /** | 172 /** |
| 172 * Write the [value] of the property with the given [name]. | 173 * Write the [value] of the property with the given [name]. |
| 173 */ | 174 */ |
| 174 void _writeProperty(String name, Object value) { | 175 void _writeProperty(String name, Object value) { |
| 175 if (value != null) { | 176 if (value != null) { |
| 176 _indent(2); | 177 _indent(2); |
| 177 buffer.write('$name = '); | 178 buffer.write('$name = '); |
| 178 buffer.write(encodeHtml(value.toString())); | 179 buffer.write(HTML_ESCAPE.convert(value.toString())); |
| 179 buffer.write('<br>'); | 180 buffer.write('<br>'); |
| 180 } | 181 } |
| 181 } | 182 } |
| 182 } | 183 } |
| OLD | NEW |