Ensure a newline after a heredoc or nowdoc string literal.
commitc668f56c37a8ab4bba257ee5207651c5fc6d12fe
authorJake Bailey <jakebailey@fb.com>
Thu, 30 Mar 2017 01:01:46 +0000 (29 18:01 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 30 Mar 2017 01:03:33 +0000 (29 18:03 -0700)
tree79d0b1affe4a0f6563c0a1473b0296474b4b1b05
parentf2e2097f54127b869f5abaf3237d74376e8ee933
Ensure a newline after a heredoc or nowdoc string literal.

Summary: Add a new fmt_node type named DocLiteral for heredoc and nowdoc string literals, since we need to ensure a newline after them in order to avoid breaking them (since the DocLiteral closing identifier may not be followed by any characters except "\n" or ";\n").

Reviewed By: eshrews

Differential Revision: D4787624

fbshipit-source-id: 191b852ba30f21de675959b6698ba5871fd57589
hphp/hack/src/hackfmt/chunk_builder.ml
hphp/hack/src/hackfmt/fmt_node.ml
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/test/hackfmt/tests/doc_string_literals.php [new file with mode: 0644]
hphp/hack/test/hackfmt/tests/doc_string_literals.php.exp [new file with mode: 0644]