Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: lib/src/linter.dart

Issue 1463553002: Add a utility method so that it can be added to the superclass without breaking the build (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698