2014-09-04 16:56:27 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
2014-11-05 01:28:30 +00:00
|
|
|
#include "frontends/lean/info_annotation.h"
|
2014-09-04 16:56:27 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2014-11-05 01:28:30 +00:00
|
|
|
static name * g_no_info = nullptr;
|
|
|
|
name const & get_no_info() { return *g_no_info; }
|
|
|
|
|
|
|
|
expr mk_no_info(expr const & e) { return mk_annotation(get_no_info(), e); }
|
|
|
|
bool is_no_info(expr const & e) { return is_annotation(e, get_no_info()); }
|
|
|
|
|
2014-09-22 22:26:41 +00:00
|
|
|
static name * g_extra_info = nullptr;
|
|
|
|
name const & get_extra_info() { return *g_extra_info; }
|
2014-09-04 16:56:27 +00:00
|
|
|
|
2014-10-16 03:03:35 +00:00
|
|
|
expr mk_extra_info(expr const & e, tag g) { return mk_annotation(get_extra_info(), e, g); }
|
2014-09-04 16:56:27 +00:00
|
|
|
expr mk_extra_info(expr const & e) { return mk_annotation(get_extra_info(), e); }
|
|
|
|
bool is_extra_info(expr const & e) { return is_annotation(e, get_extra_info()); }
|
2014-09-22 22:26:41 +00:00
|
|
|
|
2014-11-05 01:47:30 +00:00
|
|
|
static name * g_notation_info = nullptr;
|
|
|
|
name const & get_notation_info() { return *g_notation_info; }
|
|
|
|
|
|
|
|
expr mk_notation_info(expr const & e, tag g) { return mk_annotation(get_notation_info(), e, g); }
|
|
|
|
expr mk_notation_info(expr const & e) { return mk_annotation(get_notation_info(), e); }
|
|
|
|
bool is_notation_info(expr const & e) { return is_annotation(e, get_notation_info()); }
|
|
|
|
|
2014-11-05 01:28:30 +00:00
|
|
|
void initialize_info_annotation() {
|
|
|
|
g_no_info = new name("no_info");
|
|
|
|
register_annotation(*g_no_info);
|
2014-09-22 22:26:41 +00:00
|
|
|
g_extra_info = new name("extra_info");
|
|
|
|
register_annotation(*g_extra_info);
|
2014-11-05 01:47:30 +00:00
|
|
|
g_notation_info = new name("notation_info");
|
|
|
|
register_annotation(*g_notation_info);
|
2014-09-22 22:26:41 +00:00
|
|
|
}
|
|
|
|
|
2014-11-05 01:28:30 +00:00
|
|
|
void finalize_info_annotation() {
|
|
|
|
delete g_no_info;
|
2014-09-22 22:26:41 +00:00
|
|
|
delete g_extra_info;
|
2014-11-05 01:47:30 +00:00
|
|
|
delete g_notation_info;
|
2014-09-22 22:26:41 +00:00
|
|
|
}
|
2014-09-04 16:56:27 +00:00
|
|
|
}
|