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 string_scanner.line_scanner; | |
6 | |
7 import 'package:charcode/ascii.dart'; | 5 import 'package:charcode/ascii.dart'; |
8 | 6 |
9 import 'string_scanner.dart'; | 7 import 'string_scanner.dart'; |
10 | 8 |
11 // Note that much of this code is duplicated in eager_span_scanner.dart. | 9 // Note that much of this code is duplicated in eager_span_scanner.dart. |
12 | 10 |
13 /// A regular expression matching newlines across platforms. | 11 /// A regular expression matching newlines across platforms. |
14 final _newlineRegExp = new RegExp(r"\r\n?|\n"); | 12 final _newlineRegExp = new RegExp(r"\r\n?|\n"); |
15 | 13 |
16 /// A subclass of [StringScanner] that tracks line and column information. | 14 /// A subclass of [StringScanner] that tracks line and column information. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 final int position; | 116 final int position; |
119 | 117 |
120 /// The zero-based line number of the scanner in this state. | 118 /// The zero-based line number of the scanner in this state. |
121 final int line; | 119 final int line; |
122 | 120 |
123 /// The zero-based column number of the scanner in this state. | 121 /// The zero-based column number of the scanner in this state. |
124 final int column; | 122 final int column; |
125 | 123 |
126 LineScannerState._(this._scanner, this.position, this.line, this.column); | 124 LineScannerState._(this._scanner, this.position, this.line, this.column); |
127 } | 125 } |
OLD | NEW |