OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.io.line_column; | 5 library dart2js.io.line_column; |
6 | 6 |
7 import 'code_output.dart'; | 7 import 'code_output.dart' show CodeOutputListener; |
8 | 8 |
9 /// Interface for providing line/column information. | 9 /// Interface for providing line/column information. |
10 abstract class LineColumnProvider { | 10 abstract class LineColumnProvider { |
11 /// Returns the line number (0-based) for [offset]. | 11 /// Returns the line number (0-based) for [offset]. |
12 int getLine(int offset); | 12 int getLine(int offset); |
13 | 13 |
14 /// Returns the column number (0-based) for [offset] at the given [line]. | 14 /// Returns the column number (0-based) for [offset] at the given [line]. |
15 int getColumn(int line, int offset); | 15 int getColumn(int line, int offset); |
16 | 16 |
17 /// Returns the offset for 0-based [line] and [column] numbers. | 17 /// Returns the offset for 0-based [line] and [column] numbers. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 @override | 73 @override |
74 void onDone(int length) { | 74 void onDone(int length) { |
75 lineStarts.add(length + 1); | 75 lineStarts.add(length + 1); |
76 this.length = length; | 76 this.length = length; |
77 } | 77 } |
78 | 78 |
79 String toString() { | 79 String toString() { |
80 return 'lineStarts=$lineStarts,length=$length'; | 80 return 'lineStarts=$lineStarts,length=$length'; |
81 } | 81 } |
82 } | 82 } |
OLD | NEW |