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

Puppet 4 lexer fails to parse multiple heredocs on the same line

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.7.5, PUP 4.0.0
    • None
    • None
    • 1
    • Language 2015-03-18, Language 2015-04-01

    Description

      Parsing this manifest:

      notice({ @(foo) => @(bar) })
      hello
      -foo
      world
      -bar
      

      Results in:

      $ puppet apply foo.pp
      Error: Could not parse for environment production: undefined local variable or method `lexing_context' for #<Puppet::Pops::Parser::Lexer2:0x007faadd1551a0> on node peterhu-osx
      

      Expected results:

      $ puppet apply foo.pp
      Notice: Scope(Class[main]): {hello => world}
      Notice: Compiled catalog for peterhu-osx in environment production in 1.18 seconds
      Notice: Applied catalog in 0.08 seconds
      

      QA risk assessment: medium (FR only for now)
      probability: low (multiple heredocs on same line)
      severity: medium (workarounds exist)
      test layer: unit (https://github.com/puppetlabs/puppet/blob/26ad83f62e1ff1d1df51591f1c2c9b555484d3e0/spec/unit/pops/parser/parse_heredoc_spec.rb#L117-L136)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              peter.huene Peter Huene
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support