feat(frontends/lean/elaborator): generate identifier information for overloaded identifiers
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
0073ddf583
commit
dcc8f4e4fc
2 changed files with 9 additions and 1 deletions
|
@ -159,7 +159,6 @@ num → num
|
||||||
num
|
num
|
||||||
-- ACK
|
-- ACK
|
||||||
-- IDENTIFIER|15|42
|
-- IDENTIFIER|15|42
|
||||||
f
|
|
||||||
foo.f
|
foo.f
|
||||||
-- ACK
|
-- ACK
|
||||||
-- ENDINFO
|
-- ENDINFO
|
||||||
|
|
|
@ -374,6 +374,8 @@ class elaborator {
|
||||||
virtual optional<constraints> next() {
|
virtual optional<constraints> next() {
|
||||||
while (m_idx < get_num_choices(m_choice)) {
|
while (m_idx < get_num_choices(m_choice)) {
|
||||||
expr const & c = get_choice(m_choice, m_idx);
|
expr const & c = get_choice(m_choice, m_idx);
|
||||||
|
expr const & f = get_app_fn(c);
|
||||||
|
m_elab.save_identifier_info(f);
|
||||||
m_idx++;
|
m_idx++;
|
||||||
try {
|
try {
|
||||||
new_scope s(m_elab, m_ctx, m_full_ctx);
|
new_scope s(m_elab, m_ctx, m_full_ctx);
|
||||||
|
@ -914,6 +916,13 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void save_identifier_info(expr const & f) {
|
||||||
|
if (!m_noinfo && infom() && pip() && is_constant(f)) {
|
||||||
|
if (auto p = pip()->get_pos_info(f))
|
||||||
|
m_pre_info_data.add_identifier_info(p->first, p->second, const_name(f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void save_synth_data(expr const & e, expr const & r) {
|
void save_synth_data(expr const & e, expr const & r) {
|
||||||
if (!m_noinfo && infom() && pip() && is_placeholder(e)) {
|
if (!m_noinfo && infom() && pip() && is_placeholder(e)) {
|
||||||
if (auto p = pip()->get_pos_info(e)) {
|
if (auto p = pip()->get_pos_info(e)) {
|
||||||
|
|
Loading…
Reference in a new issue