Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for with multiline expression enumerator #358

Open
susliko opened this issue Sep 19, 2023 · 0 comments
Open

for with multiline expression enumerator #358

susliko opened this issue Sep 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@susliko
Copy link
Collaborator

susliko commented Sep 19, 2023

Commit of tree-sitter-scala you tested this on

59ab070

A code sample showing the error

for 
  _ <- a *>
       b
yield ()

Show the error node

(compilation_unit [0, 0] - [4, 0]
  (ERROR [0, 0] - [4, 0]
    (enumerators [1, 2] - [4, 0]
      (enumerator [1, 2] - [1, 11]
        (wildcard [1, 2] - [1, 3])
        (postfix_expression [1, 7] - [1, 11]
          (identifier [1, 7] - [1, 8])
          (operator_identifier [1, 9] - [1, 11])))
      (ERROR [2, 7] - [3, 8]
        (infix_pattern [2, 7] - [3, 8]
          left: (identifier [2, 7] - [2, 8])
          operator: (identifier [3, 0] - [3, 5])
          right: (tuple_pattern [3, 6] - [3, 8]
            (identifier [3, 7] - [3, 7])))))))

What do you expect the tree to look like

(compilation_unit [0, 0] - [3, 0]
  (for_expression [0, 0] - [2, 8]
    enumerators: (enumerators [1, 2] - [2, 0]
      (enumerator [1, 2] - [1, 13]
        (wildcard [1, 2] - [1, 3])
        (infix_expression [1, 7] - [1, 13]
          left: (identifier [1, 7] - [1, 8])
          operator: (operator_identifier [1, 9] - [1, 11])
          right: (identifier [1, 12] - [1, 13]))))
    body: (unit [2, 6] - [2, 8])))

Where are you experiencing this error?

vanilla tree-sitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant