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

LiteralString class parameters get parsed with positioning information that includes a negative length

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.6.1
    • Fix Version/s: PUP 3.7.0
    • Component/s: Compiler
    • Labels:
    • Template:
    • Story Points:
      1
    • Sprint:
      2014-07-23

      Description

      When using the future parser, any class parameter with a LiteralString value receive positioning information with a negative length:

      # param_test.rb
      require 'puppet'
      require 'puppet/pops'
       
      parser = Puppet::Pops::Parser::Parser.new
       
      result = parser.parse_string <<-EOM
      class test::class (
        $param_one = undef,
        $param_two = 'some string',
        $param_three = true,
        $param_four = 'another string',
        $param_five = $some::varaible::somewhere, 
      ) {}
      EOM
       
      result.current.definitions.each do |d|
        d.parameters.each do |p|
          puts "#{p.name}: #{p.value.length}"
        end
      end
      

      # ruby param_test.rb
      param_one: 5
      param_two: -13
      param_three: 4
      param_four: -16
      param_five: 26
      

      This prevents SourcePosAdapters attached to these object from being fully functional.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support