| 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 analyzer.src.generated.source; | 5 library analyzer.src.generated.source; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 */ | 193 */ |
| 194 int _previousLine = 0; | 194 int _previousLine = 0; |
| 195 | 195 |
| 196 /** | 196 /** |
| 197 * Initialize a newly created set of line information to represent the data | 197 * Initialize a newly created set of line information to represent the data |
| 198 * encoded in the given list of [_lineStarts]. | 198 * encoded in the given list of [_lineStarts]. |
| 199 */ | 199 */ |
| 200 factory LineInfo(List<int> _lineStarts) => new LineInfoWithCount(_lineStarts); | 200 factory LineInfo(List<int> _lineStarts) => new LineInfoWithCount(_lineStarts); |
| 201 | 201 |
| 202 /** | 202 /** |
| 203 * Initialize a newly created set of line information corresponding to the |
| 204 * given file [content]. |
| 205 */ |
| 206 factory LineInfo.fromContent(String content) => |
| 207 new LineInfoWithCount(StringUtilities.computeLineStarts(content)); |
| 208 |
| 209 /** |
| 203 * Initialize a newly created set of line information to represent the data | 210 * Initialize a newly created set of line information to represent the data |
| 204 * encoded in the given list of [_lineStarts]. | 211 * encoded in the given list of [_lineStarts]. |
| 205 */ | 212 */ |
| 206 LineInfo._(this._lineStarts) { | 213 LineInfo._(this._lineStarts) { |
| 207 if (_lineStarts == null) { | 214 if (_lineStarts == null) { |
| 208 throw new IllegalArgumentException("lineStarts must be non-null"); | 215 throw new IllegalArgumentException("lineStarts must be non-null"); |
| 209 } else if (_lineStarts.length < 1) { | 216 } else if (_lineStarts.length < 1) { |
| 210 throw new IllegalArgumentException("lineStarts must be non-empty"); | 217 throw new IllegalArgumentException("lineStarts must be non-empty"); |
| 211 } | 218 } |
| 212 } | 219 } |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 Source resolveAbsolute(Uri uri, [Uri actualUri]); | 1124 Source resolveAbsolute(Uri uri, [Uri actualUri]); |
| 1118 | 1125 |
| 1119 /** | 1126 /** |
| 1120 * Return an absolute URI that represents the given [source], or `null` if a | 1127 * Return an absolute URI that represents the given [source], or `null` if a |
| 1121 * valid URI cannot be computed. | 1128 * valid URI cannot be computed. |
| 1122 * | 1129 * |
| 1123 * The computation should be based solely on [source.fullName]. | 1130 * The computation should be based solely on [source.fullName]. |
| 1124 */ | 1131 */ |
| 1125 Uri restoreAbsolute(Source source) => null; | 1132 Uri restoreAbsolute(Source source) => null; |
| 1126 } | 1133 } |
| OLD | NEW |