findEndOfMultilineItem method

String? findEndOfMultilineItem(
  1. Searcher endSearcher,
  2. Position end
)

Searches the end of a multi line comment or string. endSearcher defines the pattern of the searched item. end: OUT stores the end of the item. Returns null on success or the error message.

Implementation

String? findEndOfMultilineItem(Searcher endSearcher, Position end) {
  String? rc;
  if (!engine.search(endSearcher,
      relativePosition: RelativePosition.belowLast)) {
    final marker = (endSearcher as StringSearcher).toSearch;
    rc = 'syntax error: missing end marker $marker for item starting in $end';
  } else {
    end.clone(engine.currentPosition);
  }
  return rc;
}