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 linter.src.linter; | 5 library linter.src.linter; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 contents: sourceFile.readAsStringSync(), sourcePath: sourceFile.path); | 418 contents: sourceFile.readAsStringSync(), sourcePath: sourceFile.path); |
419 } | 419 } |
420 | 420 |
421 class _LineInfo implements LineInfo { | 421 class _LineInfo implements LineInfo { |
422 PSNode node; | 422 PSNode node; |
423 _LineInfo(this.node); | 423 _LineInfo(this.node); |
424 | 424 |
425 @override | 425 @override |
426 LineInfo_Location getLocation(int offset) => new LineInfo_Location( | 426 LineInfo_Location getLocation(int offset) => new LineInfo_Location( |
427 node.span.start.line + 1, node.span.start.column + 1); | 427 node.span.start.line + 1, node.span.start.column + 1); |
| 428 |
| 429 int getOffsetOfLine(int lineNumber) { |
| 430 throw new UnsupportedError('Cannot get line offset from a yaml node'); |
| 431 } |
428 } | 432 } |
429 | 433 |
430 class _LintCode extends LintCode { | 434 class _LintCode extends LintCode { |
431 static final registry = <String, LintCode>{}; | 435 static final registry = <String, LintCode>{}; |
432 | 436 |
433 factory _LintCode(String name, String message) => registry.putIfAbsent( | 437 factory _LintCode(String name, String message) => registry.putIfAbsent( |
434 name + message, () => new _LintCode._(name, message)); | 438 name + message, () => new _LintCode._(name, message)); |
435 | 439 |
436 _LintCode._(String name, String message) : super(name, message); | 440 _LintCode._(String name, String message) : super(name, message); |
437 } | 441 } |
OLD | NEW |