puppetlabs/puppet — pull request #2749 by hlindberg (2014-06-08 21:06:04+00:00)
Title: (PUP-2714) handle empty program

This changes how an empty program (no text, or only comments) is returned by the parser. It used to simply return nil, but now it returns a Model::Program (like for all other programs), with a body containing a Model::Nop instruction (that when evaluated results in nil). This makes it ieasier to write tools that performs parsing and static analysis or documentation work.

While working on this, it was detected that initial_import was called twice due to a problem with a Puppet::Resource's default environment when a Puppet::Resource is used as a reference.