| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 return new LineInfo_Location(min + 1, offset - _lineStarts[min] + 1); | 259 return new LineInfo_Location(min + 1, offset - _lineStarts[min] + 1); |
| 260 } | 260 } |
| 261 | 261 |
| 262 /** | 262 /** |
| 263 * Return the offset of the first character on the line with the given | 263 * Return the offset of the first character on the line with the given |
| 264 * [lineNumber]. | 264 * [lineNumber]. |
| 265 */ | 265 */ |
| 266 int getOffsetOfLine(int lineNumber) { | 266 int getOffsetOfLine(int lineNumber) { |
| 267 if (lineNumber < 0 || lineNumber >= lineCount) { | 267 if (lineNumber < 0 || lineNumber >= lineCount) { |
| 268 throw new ArgumentError('Invalid line number: $lineNumber'); | 268 throw new ArgumentError( |
| 269 'Invalid line number: $lineNumber; must be between 0 and ${lineCount -
1}'); |
| 269 } | 270 } |
| 270 return _lineStarts[lineNumber]; | 271 return _lineStarts[lineNumber]; |
| 271 } | 272 } |
| 272 } | 273 } |
| 273 | 274 |
| 274 /** | 275 /** |
| 275 * Instances of the class `Location` represent the location of a character as a
line and | 276 * Instances of the class `Location` represent the location of a character as a
line and |
| 276 * column pair. | 277 * column pair. |
| 277 */ | 278 */ |
| 278 class LineInfo_Location { | 279 class LineInfo_Location { |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 Source resolveAbsolute(Uri uri, [Uri actualUri]); | 934 Source resolveAbsolute(Uri uri, [Uri actualUri]); |
| 934 | 935 |
| 935 /** | 936 /** |
| 936 * Return an absolute URI that represents the given [source], or `null` if a | 937 * Return an absolute URI that represents the given [source], or `null` if a |
| 937 * valid URI cannot be computed. | 938 * valid URI cannot be computed. |
| 938 * | 939 * |
| 939 * The computation should be based solely on [source.fullName]. | 940 * The computation should be based solely on [source.fullName]. |
| 940 */ | 941 */ |
| 941 Uri restoreAbsolute(Source source) => null; | 942 Uri restoreAbsolute(Source source) => null; |
| 942 } | 943 } |
| OLD | NEW |