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

bug: error parsing $ as operator #161

Open
1 of 2 tasks
fredrikekre opened this issue Nov 28, 2024 · 0 comments
Open
1 of 2 tasks

bug: error parsing $ as operator #161

fredrikekre opened this issue Nov 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fredrikekre
Copy link

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues of tree-sitter-julia

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

Both of these examples error in the parser:

($)(a, b)
a $ b

Steps To Reproduce/Bad Parse Tree

($)(a, b) results in

(source_file ; [0, 0] - [1, 0]
  (call_expression ; [0, 0] - [0, 9]
    (tuple_expression ; [0, 0] - [0, 3]
      (ERROR)) ; [0, 1] - [0, 2]
    (argument_list ; [0, 3] - [0, 9]
      (identifier) ; [0, 4] - [0, 5]
      (identifier)))) ; [0, 7] - [0, 8]

and a $ b results in

(source_file ; [0, 0] - [1, 0]
  (ERROR) ; [0, 0] - [0, 1]
  (interpolation_expression ; [0, 2] - [0, 5]
    (identifier))) ; [0, 4] - [0, 5]

Expected Behavior/Parse Tree

($)(a, b) should probably be

(source_file ; [0, 0] - [1, 0]
  (call_expression ; [0, 0] - [0, 9]
    (parenthesized_expression ; [0, 0] - [0, 3]
      (operator)) ; [0, 1] - [0, 2]
    (argument_list ; [0, 3] - [0, 9]
      (identifier) ; [0, 4] - [0, 5]
      (identifier)))) ; [0, 7] - [0, 8]

and a $ b should probably be

(source_file ; [0, 0] - [1, 0]
  (binary_expression ; [0, 0] - [0, 5]
    (identifier) ; [0, 0] - [0, 1]
    (operator) ; [0, 2] - [0, 3]
    (identifier))) ; [0, 4] - [0, 5]

Repro

No response

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