lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

Syyntax match does not put info on variables under repetitions

Open digama0 opened this issue 3 years ago • 1 comments

syntax "repro" (ident)? ident : command
example : Lean.Syntax → Option Lean.Syntax
  | `(repro $[$x:ident]? a) => x
             --^ textDocument/hover
  | `(repro $[$x:ident]? b) => x
             --^ textDocument/hover
                             --^ textDocument/definition
  | _ => none

Only the x in the first match arm is highlighted like a variable. Furthermore, both x occurrences in the bodies jump to the x from the first match arm, which suggests that the binder for the second x is being misplaced on the syntax for the first one.

digama0 avatar Aug 13 '22 14:08 digama0

Also relevant: the issue only happens when the two variables are named the same. If the second identifier is named y, they are both highlighted independently and go to definition works as expected.

digama0 avatar Aug 13 '22 18:08 digama0