Skip to content

Spaces in parameter initialization leads to error #42

Open
@madskjeldgaard

Description

@madskjeldgaard

Adding whitespace between the argument name and the value it is initialized to leads to parsing errors:

NiceNice{
  *new{| so = \hej|}
}

Parses as:

(source_file [0, 0] - [3, 0]
  (class_def [0, 0] - [2, 1]
    (class [0, 0] - [0, 8])
    (class_method_name [1, 3] - [1, 6])
    (function_block [1, 6] - [1, 20]
      (parameter_list [1, 7] - [1, 19]
        (argument [1, 9] - [1, 11]
          name: (identifier [1, 9] - [1, 11]))
        (ERROR [1, 12] - [1, 15])
        (argument [1, 15] - [1, 18]
          name: (identifier [1, 15] - [1, 18]))))))

vs this which parses okay:

NiceNice{
  *new{| so=\hej|}
}

as:

(source_file [0, 0] - [3, 0]
  (class_def [0, 0] - [2, 1]
    (class [0, 0] - [0, 8])
    (class_method_name [1, 3] - [1, 6])
    (function_block [1, 6] - [1, 18]
      (parameter_list [1, 7] - [1, 17]
        (argument [1, 9] - [1, 16]
          name: (identifier [1, 9] - [1, 11])
          value: (literal [1, 12] - [1, 16]
            (symbol [1, 12] - [1, 16]
              (identifier [1, 13] - [1, 16]))))))))

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

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions