tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`&a?` wrong precedence

Kyuuhachi opened this issue · comments

The following code is parsed wrong:

fn f() {
	&a?
}

Neovim's TSPlayground shows the syntax tree as

function_item [0, 0] - [2, 1]
  name: identifier [0, 3] - [0, 4]
  parameters: parameters [0, 4] - [0, 6]
  body: block [0, 7] - [2, 1]
    try_expression [1, 1] - [1, 4]
      reference_expression [1, 1] - [1, 3]
        value: identifier [1, 2] - [1, 3]

The reference_expression is inside the try_expression, which is wrong.