| 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 docgen.library_helpers; | 5 library docgen.library_helpers; |
| 6 | 6 |
| 7 import 'package:logging/logging.dart'; | 7 import 'package:logging/logging.dart'; |
| 8 import 'package:markdown/markdown.dart' as markdown; | 8 import 'package:markdown/markdown.dart' as markdown; |
| 9 | 9 |
| 10 import 'exports/source_mirrors.dart'; | 10 import 'exports/source_mirrors.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 [new markdown.CodeSyntax(r'\[:\s?((?:.|\n)*?)\s?:\]')]; | 22 [new markdown.CodeSyntax(r'\[:\s?((?:.|\n)*?)\s?:\]')]; |
| 23 | 23 |
| 24 bool get includePrivateMembers { | 24 bool get includePrivateMembers { |
| 25 if (_includePrivate == null) { | 25 if (_includePrivate == null) { |
| 26 throw new StateError('includePrivate has not been set'); | 26 throw new StateError('includePrivate has not been set'); |
| 27 } | 27 } |
| 28 return _includePrivate; | 28 return _includePrivate; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void set includePrivateMembers(bool value) { | 31 void set includePrivateMembers(bool value) { |
| 32 if (_includePrivate != null) { | |
| 33 throw new StateError('includePrivate has already been set'); | |
| 34 } | |
| 35 if (value == null) throw new ArgumentError('includePrivate cannot be null'); | 32 if (value == null) throw new ArgumentError('includePrivate cannot be null'); |
| 36 _includePrivate = value; | 33 _includePrivate = value; |
| 37 } | 34 } |
| 38 | 35 |
| 39 bool _includePrivate; | 36 bool _includePrivate; |
| 40 | 37 |
| 41 /// Return true if this item and all of its owners are all visible. | 38 /// Return true if this item and all of its owners are all visible. |
| 42 bool isFullChainVisible(Indexable item) { | 39 bool isFullChainVisible(Indexable item) { |
| 43 return includePrivateMembers || (!item.isPrivate && (item.owner != null ? | 40 return includePrivateMembers || (!item.isPrivate && (item.owner != null ? |
| 44 isFullChainVisible(item.owner) : true)); | 41 isFullChainVisible(item.owner) : true)); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 append = true; | 211 append = true; |
| 215 } | 212 } |
| 216 index++; | 213 index++; |
| 217 } | 214 } |
| 218 } | 215 } |
| 219 return tokens; | 216 return tokens; |
| 220 } | 217 } |
| 221 | 218 |
| 222 // HTML escaped version of '<' character. | 219 // HTML escaped version of '<' character. |
| 223 const _LESS_THAN = '<'; | 220 const _LESS_THAN = '<'; |
| OLD | NEW |