protected static function matchImpl()

in src/expression/NowdocStringLiteralExpression.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($$, "<<<'")
      |> Str\strip_suffix($$, "'");

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