protected static function matchImpl()

in src/expression/HeredocStringLiteralExpression.hack [19:33]


  protected static function matchImpl(
    self::TNode $n,
  ): ?Expression<string> {
    $text = $n->getText();
    $newline = Str\search($text, "\n");
    if ($newline === null) {
      return null;
    }
    $marker = Str\slice($text, 0, $newline) |> Str\strip_prefix($$, '<<<');

    return $text
      |> Str\slice($$, $newline + 1)
      |> Str\strip_suffix($$, "\n".$marker)
      |> new self($$);
  }