refactor(kernel/context): hide that the context is implemented using lists
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
1cb7408c46
commit
0d815b8594
2 changed files with 3 additions and 2 deletions
|
@ -1921,7 +1921,7 @@ class parser::imp {
|
|||
else
|
||||
new_entries.emplace_back(e.get_name(), d, *b);
|
||||
}
|
||||
context mvar_ctx(to_list(new_entries.begin(), new_entries.end()));
|
||||
context mvar_ctx(new_entries.size(), new_entries.data());
|
||||
return mk_pair(mvar_type, mvar_ctx);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
*/
|
||||
class context {
|
||||
list<context_entry> m_list;
|
||||
explicit context(list<context_entry> const & l):m_list(l) {}
|
||||
public:
|
||||
context() {}
|
||||
context(context const & c, name const & n, optional<expr> const & d, expr const & b):m_list(context_entry(n, d, b), c.m_list) {}
|
||||
|
@ -43,8 +44,8 @@ public:
|
|||
context(context const & c, name const & n, expr const & d, expr const & b):m_list(context_entry(n, d, b), c.m_list) {}
|
||||
context(context const & c, name const & n, expr const & d):m_list(context_entry(n, d), c.m_list) {}
|
||||
context(context const & c, context_entry const & e):m_list(e, c.m_list) {}
|
||||
context(unsigned sz, context_entry const * es):context(to_list(es, es + sz)) {}
|
||||
context(std::initializer_list<std::pair<char const *, expr const &>> const & l);
|
||||
explicit context(list<context_entry> const & l):m_list(l) {}
|
||||
context_entry const & lookup(unsigned vidx) const;
|
||||
std::pair<context_entry const &, context> lookup_ext(unsigned vidx) const;
|
||||
/** \brief Similar to lookup, but always succeed */
|
||||
|
|
Loading…
Reference in a new issue