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

Puppet 4 lexer misinterprets multiple '/' tokens as a regex following a variable.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.5
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-02-04

      Description

      Expected the following code to notice "2":

      $foo = 2
      notice ($foo / 1 / 1)
      

      But instead received this (quite cryptic) error:

      $ puppet apply foo.pp
      Error: Could not parse for environment production: Syntax error at '(?-mix: 1 )' at foo.pp:2:14 on node foo
      

      It looks like the lexer isn't handling variables in regexp_acceptable?.

      Related: should it also do the same for bare words (it handles names already)?

      Workaround by forcing the next token following the variable to be something other than '/':

      $foo = 2
      notice (($foo) / 1 / 1)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                peter.huene Peter Huene
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support