printer: Fix handling of line comments in multi-line statements. by octo · Pull Request #244 · hashicorp/hcl (original) (raw)

This fixes comment handling in situations such as:

everything = // comment
42

Previously the comment would "leak" to a later line, potentially disturbing heredoc markers (see the included test for a demonstration).

Kudos to dvyukov/go-fuzz for finding this!