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

Empty LiteralHash and LiteralList parameters get parsed with positioning information that excludes their closing delimiter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.7.3
    • Fix Version/s: PUP 3.7.4
    • Component/s: Compiler
    • Labels:
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-01-21

      Description

      Reproduction Case

      # literal_test.rb
      require 'puppet'
      require 'puppet/pops'
       
      parser = Puppet::Pops::Parser::Parser.new
        
      result = parser.parse_string <<-EOM
      class test::class (
        $param_one = {},
        $param_two = { },
        $param_three = {a => b},
        $param_four = [],
        $param_five = [ ],
        $param_six = [a],
      ) {}
      EOM
       
      result.current.definitions.each do |d|
        d.parameters.each do |p|
          puts "#{p.name}: #{p.value.length}"
        end
      end
      

      Outcome

      # ruby literal_test.rb 
      param_one: 1
      param_two: 1
      param_three: 8
      param_four: 1
      param_five: 1
      param_six: 3
      

      Expected Outcome

      Params one and four get parsed with a length of 2 and params two and five get a length of 3.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              chuck Charlie Sharpsteen
              QA Contact:
              Kurt Wall Kurt Wall
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support