lean
lean copied to clipboard
fix(frontends/lean/parser): start positions of trailing parser (NuD) nodes
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.)
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