lean icon indicating copy to clipboard operation
lean copied to clipboard

fix(frontends/lean/parser): start positions of trailing parser (NuD) nodes

Open digama0 opened this issue 1 year ago • 1 comments

As observed by @eric-wieser , the node for notation[$] in

theorem foo : true :=
id $ trivial

was covering only the span $ trivial instead of id $ trivial, meaning that the id child is outside of the span of its parent node. The fix is to take the start position from the start position of the first child instead of the current parser position when we parse a trailing node. (We also want to use this position for most other activities like constructing multiple expressions all with the same position due to notation expansion, but not for the error message when the parse is invalid.)

digama0 avatar Nov 18 '22 10:11 digama0

CI seems unhappy with this test:

https://github.com/leanprover-community/lean/blob/cb0da9f301ab2b85d8d96847c41b92d973a7b151/tests/lean/interactive/info.lean#L15-L16

which no longer produces

https://github.com/leanprover-community/lean/blob/cb0da9f301ab2b85d8d96847c41b92d973a7b151/tests/lean/interactive/info.lean.expected.out#L8

eric-wieser avatar Nov 18 '22 12:11 eric-wieser