match method

bool match(
  1. String line,
  2. int startColumn, {
  3. bool isFirstLine = true,
})

Tests whether the block entry matches the line starting with startColumn. true: the line matches.

Implementation

bool match(String line, int startColumn, {bool isFirstLine = true}) {
  var rc;
  switch (entryType) {
    case BlockEntryType.line:
      rc = searcher.next(line, startColumn) != null;
      break;
    case BlockEntryType.sequence:
      rc = searcher.next(line, startColumn) != null;
      break;
    case BlockEntryType.notSequence:
      rc = searcher.next(line, startColumn) == null;
      break;
    case BlockEntryType.startEndSequence:
      if (isFirstLine) {
        rc = searcher.next(line, startColumn) != null;
      } else {
        rc = searcherEnd?.next(line, startColumn) != null;
      }
      break;
  }
  return rc;
}