lean2/src/kernel/pos_info_provider.cpp
Leonardo de Moura dc0e7a4472 feat(pos_info_provider): add position information provider for expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-22 08:15:36 -07:00

18 lines
530 B
C++

/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include "kernel/pos_info_provider.h"
namespace lean {
format pos_info_provider::pp(expr const & e) const {
try {
auto p = get_pos_info(e);
return paren(format{format("line"), colon(), space(), format(p.first), colon(), space(), format("pos"), colon(), space(), format(p.second)});
} catch (exception &) {
return format();
}
}
}