[PUP-7094] The parser dump output formatting is off Created: 2017/01/12  Updated: 2017/05/31  Resolved: 2017/04/20

Status: Closed
Project: Puppet
Component/s: Language
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Rune Juhl Jacobsen Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Team: Puppet Developer Experience
Story Points: 1
Sprint: Forge - To Accept
QA Risk Assessment: Needs Assessment

 Description   

In testing a small parser for the AST that `puppet parser dump` outputs I stumbled upon the following oddity:

runejuhl@bucaramanga:~$ puppet --version
4.8.1
runejuhl@bucaramanga:~$ cat puppet-fails.pp
class test {
  $x = "a
a"
  $y = "a
 a"
}
runejuhl@bucaramanga:~$ puppet parser dump --validate puppet-fails.pp
--- puppet-fails.pp(class test (block
  (= $x 'a
a')
  (= $y'a
 a')
))

Note the missing whitespace in the AST between the variable $y and the string. The only difference between the variables $x and $y in the Puppet .pp file is that the second line of the latter string begins with a space.

While it's not often you see multiline strings in Puppet (in my experience), it should be supported as per https://docs.puppet.com/puppet/4.8/lang_data_string.html#double-quoted-strings



 Comments   
Comment by Henrik Lindberg [ 2017/01/13 ]

Did you also notice a problem in what the parser actually produced - i.e. does it evaluate correctly?
I have a suspicion that there is something wrong with the dump output rather than parsing.

Comment by Rune Juhl Jacobsen [ 2017/01/20 ]

Hi Henrik,
The code evaluates correctly so you're no doubt right; the problem must lie in the s-expression representation of the internal structures. I'm a bit embarrassed that it didn't cross my mind...

Anyway, thank you for your help.

Comment by Eric Sorenson [ 2017/04/20 ]

Closing as not-a-bug.

Generated at Tue Aug 20 08:49:18 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.