mark method

void mark(
  1. Object mark
)

Marks that the current point in the target file corresponds to the mark in the source file, which can be either a SourceLocation or a SourceSpan. When the mark is a SourceMapSpan with isIdentifier set, this also records the name of the identifier in the source map information.

Implementation

void mark(Object mark) {
  late final SourceLocation loc;
  String? identifier;
  if (mark is SourceLocation) {
    loc = mark;
  } else if (mark is SourceSpan) {
    loc = mark.start;
    if (mark is SourceMapSpan && mark.isIdentifier) identifier = mark.text;
  }
  _maps.addLocation(loc,
      SourceLocation(_buff.length, line: _line, column: _column), identifier);
  _loc = loc;
}