next method

bool next(
  1. TokenType type, {
  2. Iterable<String> exclude = const [],
})

Implementation

bool next(TokenType type, {Iterable<String> exclude = const []}) {
  var tok = peek();
  if (tok?.type == type && exclude.contains(tok?.span?.text) != true) {
    _current = tokens[++_index];
    return true;
  }

  return false;
}