skipWordIf method

bool skipWordIf(
  1. String word
)

Moves past current if it is the name word.

Implementation

bool skipWordIf(String word) {
  if (current.kind != 'name' || current.text != word) return false;
  position++;
  return true;
}