Skip to content

using the . operator fails due to ability to look back #36

Description

@logicminds

When the . operator is used to signify that the result of the previous line the repl does not seem to be aware of the previous operation so puppet concludes the code is a syntax error.

Example:

1:>> $var1 = [1,2,3,4]
 => [
  [0] 1,
  [1] 2,
  [2] 3,
  [3] 4
]
2:>> .map | $num | {  notice($num) }
 => Syntax error at '.' at line 1:1

This is happening because the parser that checks for multiline is not aware of the scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions