setTokens method

void setTokens({
  1. required Token token,
  2. int? line,
  3. int? column,
})

Set current tokens.

Implementation

void setTokens({required Token token, int? line, int? column}) {
  curTok = firstTok = token;
  this.line = line ?? 0;
  this.column = column ?? 0;

  Token cur = token;
  while (cur.next != null) {
    cur = cur.next!;
  }
  endOfFile = cur;
}