Skip to content

bug: * operator in ..*a incorrectly parsed as binary operator when it should be a dereference #291

@AlienKevin

Description

@AlienKevin

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-rust

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

"web-tree-sitter": "^0.23.0"

Describe the bug

* operator in ..*a incorrectly parsed as binary operator when it should be a dereference.

This pattern is real and appeared in Tokio source code: https://docs.rs/tokio/latest/src/tokio/io/util/buf_writer.rs.html#80

Steps To Reproduce/Bad Parse Tree

Image

https://intmainreturn0.com/ts-visualizer/#H4sIAAAAAAAAE6tWyknMSy9NTE9VslIqKi0uUdJRSs5PAfH09LQSrZV0lEpSi4pTlazSEnOKU2sBw5b/qjAAAAA=

Expected Behavior/Parse Tree

* should be a unary dereference operator.

Repro

// Example code that causes the issue
fn foo() {
  // Code that fails to parse, or causes an error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions