Skip to content

Commit e9b2b81

Browse files
authored
Rename _getNext to _readNext (flutter#20)
"read" is more descriptive since it generally falls through to something which reads from `_scanner` and changes state. Follows https://dart.dev/guides/language/effective-dart/design#avoid-starting-a-method-name-with-get
1 parent 8c4c0f8 commit e9b2b81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/scanner.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ class Scanner {
4040
///
4141
/// Throws a [StateError] if a [TokenType.endOfFile] token has already been
4242
/// consumed.
43-
Token peek() => _next ??= _getNext();
43+
Token peek() => _next ??= _readNext();
4444

4545
/// Consumes and returns the next token in the stream.
4646
///
4747
/// Throws a [StateError] if a [TokenType.endOfFile] token has already been
4848
/// consumed.
4949
Token next() {
50-
var token = _next ?? _getNext();
50+
var token = _next ?? _readNext();
5151
_endOfFileEmitted = token.type == TokenType.endOfFile;
5252
_next = null;
5353
return token;
@@ -65,7 +65,7 @@ class Scanner {
6565
}
6666

6767
/// Scan and return the next token in the stream.
68-
Token _getNext() {
68+
Token _readNext() {
6969
if (_endOfFileEmitted) throw StateError('No more tokens.');
7070

7171
_consumeWhitespace();

0 commit comments

Comments
 (0)