public function withLeftTrimmedFirstLine()

in src/unparsed-blocks/Lines.php [111:132]


  public function withLeftTrimmedFirstLine(): Lines {
    list($col, $line) = $this->lines[0];

    $len = Str\length($line);
    for ($i = 0; $i < $len; ++$i) {
      $char = $line[$i];
      if ($char !== ' ' && $char !== "\t") {
        break;
      }
    }

    if ($i === 0) {
      return $this;
    }

    return new self(
      Vec\concat(
        vec[tuple($col + $i , Str\slice($line, $i))],
        Vec\drop($this->lines, 1),
      ),
    );
  }