Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Rename _getNext to _readNext #20

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/src/scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class Scanner {
///
/// Throws a [StateError] if a [TokenType.endOfFile] token has already been
/// consumed.
Token peek() => _next ??= _getNext();
Token peek() => _next ??= _readNext();

/// Consumes and returns the next token in the stream.
///
/// Throws a [StateError] if a [TokenType.endOfFile] token has already been
/// consumed.
Token next() {
var token = _next ?? _getNext();
var token = _next ?? _readNext();
_endOfFileEmitted = token.type == TokenType.endOfFile;
_next = null;
return token;
Expand All @@ -65,7 +65,7 @@ class Scanner {
}

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

_consumeWhitespace();
Expand Down