throwForCurrentLine function

Never throwForCurrentLine(
  1. SourceIterator iterator, {
  2. required String message,
  3. RuneOffset? end,
})

Throw a YamlParseException with the current active line whose characters are being iterated. The line is highlighted from the start to the end.

Implementation

Never throwForCurrentLine(
  SourceIterator iterator, {
  required String message,
  RuneOffset? end,
}) {
  final (:start, :current) = iterator.currentLineInfo;
  return throwWithRangedOffset(
    iterator,
    message: message,
    start: start,
    end: end ?? current,
  );
}