Skip to content

Conversation

@digama0
Copy link
Member

@digama0 digama0 commented Nov 18, 2022

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.)

@eric-wieser
Copy link
Member

eric-wieser commented Nov 18, 2022

CI seems unhappy with this test:

example := [tt]++[]
--^ "command": "info"

which no longer produces

{"record":{"full-id":"has_append.append","source":,"state":"⊢ list bool","type":"Π {α : Type} [self : has_append α], α → α → α"},"response":"ok","seq_num":16}

lean_assert(curr() == token_kind::Keyword);
auto p = pos();
auto cur_pos = pos();
auto p = left ? expr_ast(*left).m_start : cur_pos;
Copy link
Member

@eric-wieser eric-wieser Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this change; I'm probably blind, but it appears that nothing uses p below any more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants