Token.eof constructor

Token.eof(
  1. int offset,
  2. [CommentToken? precedingComments]
)

Initialize a newly created end-of-file token to have the given offset.

Implementation

factory Token.eof(int offset, [CommentToken? precedingComments]) {
  Token eof = new SimpleToken(TokenType.EOF, offset, precedingComments);
  // EOF points to itself so there's always infinite look-ahead.
  eof.previous = eof;
  eof.next = eof;
  return eof;
}