Tape
Class that wraps a callable with a tape. Do not use directly. Use fromCallable instead.
Constructor Summary
Public Constructor | ||
public |
constructor(callable: Function) The constructor. |
Member Summary
Public Members | ||
public |
Buffer used to implement Tape#unread. |
|
public |
The callable yielding values to put on the tape. |
|
public |
eof: any The eof symbol. |
Method Summary
Public Methods | ||
public |
[Symbol.asyncIterator](): AsyncIterator Returns an async iterator on the tokens of the tape. |
|
public |
Explicitely throws when trying to access iterator symbol. |
|
public |
Returns the next token on the tape or Tape#eof if the tape has been exhausted. |
|
public |
async skip() Skips the next token on the tape. |
|
public |
Skip the next |
|
public |
unread(token: any) Puts a token back on the tape. |
Public Constructors
Public Members
Public Methods
public [Symbol.asyncIterator](): AsyncIterator source
Returns an async iterator on the tokens of the tape.
Return:
AsyncIterator | Iterator on the tokens of the tape. |
Example:
fromString('abc');
for await ( const token of tape ) console.log(token) ;
public [Symbol.iterator]() source
Explicitely throws when trying to access iterator symbol.
Throw:
Always. |
public async read(): Promise source
Returns the next token on the tape or Tape#eof if the tape has been exhausted.