Skip to content

bug: error parsing $ as operator #161

@fredrikekre

Description

@fredrikekre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions