Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7094

The parser dump output formatting is off

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • 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

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            runejuhl Rune Juhl Jacobsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support