Skip to content

Commit

Permalink
test_runner: remove scanAll()
Browse files Browse the repository at this point in the history
  • Loading branch information
manekinekko committed Jun 27, 2022
1 parent 75d347b commit 5db6310
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions lib/internal/test_runner/tap_lexer.js
Expand Up @@ -170,12 +170,6 @@ class TapLexer {
yield this.scanEOF();
}

*scanAll() {
for (const token of this.scan()) {
yield token;
}
}

next() {
return this.source.next();
}
Expand Down Expand Up @@ -241,7 +235,10 @@ class TapLexer {
// if the escape symbol has been escaped (by previous symbol),
// or if the next symbol is a whitespace symbol,
// then consume it as a literal.
if (this.hasTheCurrentCharacterBeenEscaped() || this.source.peek(1) === TokenKind.WHITESPACE) {
if (
this.hasTheCurrentCharacterBeenEscaped() ||
this.source.peek(1) === TokenKind.WHITESPACE
) {
this.escapeStack.pop();
return new Token({
kind: TokenKind.LITERAL,
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/test_runner/tap_parser.js
Expand Up @@ -35,7 +35,7 @@ const { TapLexer, TokenKind } = require('internal/test_runner/tap_lexer');
class TapParser {
constructor(input, options = {}) {
this.lexer = new TapLexer(input);
this.tokens = this.chunk(this.lexer.scanAll());
this.tokens = this.chunk(this.lexer.scan());
this.currentTokenIndex = 0;
this.currentTokenChunk = 0;
this.currentToken = null;
Expand Down

0 comments on commit 5db6310

Please sign in to comment.