scan method

bool scan (Pattern pattern)
override

If pattern matches at the current position of the string, scans forward until the end of the match.

Returns whether or not pattern matched.

Implementation

bool scan(Pattern pattern) {
  if (!super.scan(pattern)) return false;

  var newlines = _newlinesIn(lastMatch[0]);
  _line += newlines.length;
  if (newlines.isEmpty) {
    _column += lastMatch[0].length;
  } else {
    _column = lastMatch[0].length - newlines.last.end;
  }

  return true;
}