refactor(library): remove unnecessary 'standard' subdirectory

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-08-23 18:08:09 -07:00
parent 505b93b7cb
commit dbaf81e16d
89 changed files with 17 additions and 28 deletions

View file

@ -6,7 +6,7 @@ if [ $# -ne 2 ]; then
fi
ulimit -s unlimited
LEAN=$1
export LEAN_PATH=.:../../library/standard
export LEAN_PATH=.:../../library
f=$2
i=0
in_code_block=0

1
library/Makefile Normal file
View file

@ -0,0 +1 @@
include Makefile.common

View file

@ -1 +0,0 @@
include ../Makefile.common

View file

@ -311,9 +311,9 @@ if((${CYGWIN} EQUAL "1") OR (NOT (${CMAKE_SYSTEM_NAME} MATCHES "Windows")))
# Only build libraries if we are NOT cross compiling
add_custom_target(
standard_lib ALL
COMMAND make -j ${PROCESSOR_COUNT} LEAN_PATH=.:${LEAN_SOURCE_DIR}/../library/standard LEAN="${CMAKE_SOURCE_DIR}/../bin/lean"
COMMAND make -j ${PROCESSOR_COUNT} LEAN_PATH=.:${LEAN_SOURCE_DIR}/../library LEAN="${CMAKE_SOURCE_DIR}/../bin/lean"
DEPENDS ${CMAKE_BINARY_DIR}/shell/lean
WORKING_DIRECTORY ${LEAN_SOURCE_DIR}/../library/standard
WORKING_DIRECTORY ${LEAN_SOURCE_DIR}/../library
)
endif()

View file

@ -21,7 +21,6 @@ Author: Leonardo de Moura
#include "kernel/kernel_exception.h"
#include "kernel/formatter.h"
#include "library/standard_kernel.h"
#include "library/hott_kernel.h"
#include "library/module.h"
#include "library/io_state_stream.h"
#include "library/definition_cache.h"
@ -43,7 +42,6 @@ using lean::io_state;
using lean::io_state_stream;
using lean::regular;
using lean::mk_environment;
using lean::mk_hott_environment;
using lean::set_environment;
using lean::set_io_state;
using lean::definition_cache;
@ -81,7 +79,6 @@ static void display_help(std::ostream & out) {
std::cout << " --trust=num -t trust level (default: 0) \n";
std::cout << " --quiet -q do not print verbose messages\n";
std::cout << " --server start Lean in 'server' mode\n";
std::cout << " --hott use Homotopy Type Theory kernel and libraries\n";
std::cout << " --threads=num -j number of threads used to process lean files\n";
std::cout << " --deps just print dependencies of a Lean input\n";
std::cout << " --flycheck print structured error message for flycheck\n";
@ -119,7 +116,6 @@ static struct option g_long_options[] = {
{"trust", required_argument, 0, 't'},
{"server", no_argument, 0, 'S'},
{"quiet", no_argument, 0, 'q'},
{"hott", no_argument, 0, 'H'},
{"threads", required_argument, 0, 'j'},
{"cache", required_argument, 0, 'c'},
{"deps", no_argument, 0, 'D'},
@ -133,13 +129,11 @@ static struct option g_long_options[] = {
};
#if defined(LEAN_USE_BOOST)
static char const * g_opt_str = "PFDHSqlupgvhj:012k:012s:012t:012o:c:i:";
static char const * g_opt_str = "PFDSqlupgvhj:012k:012s:012t:012o:c:i:";
#else
static char const * g_opt_str = "PFDHSqlupgvhj:012k:012t:012o:c:i:";
static char const * g_opt_str = "PFDSqlupgvhj:012k:012t:012o:c:i:";
#endif
enum class lean_mode { Standard, HoTT };
class simple_pos_info_provider : public pos_info_provider {
char const * m_fname;
public:
@ -160,7 +154,6 @@ int main(int argc, char ** argv) {
bool only_deps = false;
bool flycheck = false;
bool permissive = false;
lean_mode mode = lean_mode::Standard;
unsigned num_threads = 1;
bool use_cache = false;
bool gen_index = false;
@ -176,10 +169,6 @@ int main(int argc, char ** argv) {
case 'j':
num_threads = atoi(optarg);
break;
case 'H':
mode = lean_mode::HoTT;
lean::init_lean_path("hott");
break;
case 'S':
server = true;
break;
@ -240,7 +229,7 @@ int main(int argc, char ** argv) {
}
}
environment env = mode == lean_mode::Standard ? mk_environment(trust_lvl) : mk_hott_environment(trust_lvl);
environment env = mk_environment(trust_lvl);
io_state ios(lean::mk_pretty_formatter_factory());
if (quiet)
ios.set_option("verbose", false);

View file

@ -107,13 +107,13 @@ std::string get_path(std::string f) {
static std::string g_lean_path;
static std::vector<std::string> g_lean_path_vector;
void init_lean_path(char const * kernel_instance_name) {
void init_lean_path() {
char * r = getenv("LEAN_PATH");
if (r == nullptr) {
g_lean_path = ".";
std::string exe_path = get_path(get_exe_location());
g_lean_path += g_path_sep;
g_lean_path += exe_path + g_sep + ".." + g_sep + "library" + g_sep + kernel_instance_name;
g_lean_path += exe_path + g_sep + ".." + g_sep + "library";
} else {
g_lean_path = r;
}
@ -134,7 +134,7 @@ void init_lean_path(char const * kernel_instance_name) {
}
struct init_lean_path_fn {
init_lean_path_fn() { init_lean_path("standard"); }
init_lean_path_fn() { init_lean_path(); }
};
static init_lean_path_fn g_init_lean_path_fn;
static std::string g_sep_str(1, g_sep);

View file

@ -16,8 +16,8 @@ public:
file_not_found_exception(std::string const & fname);
};
/** \brief Initialize the lean_path for the given kernel instance */
void init_lean_path(char const * kernel_instance_name);
/** \brief Initialize the lean_path */
void init_lean_path();
/** \brief Return the LEAN_PATH string */
char const * get_lean_path();
/**

View file

@ -5,7 +5,7 @@ if [ $# -ne 3 -a $# -ne 2 ]; then
fi
ulimit -s unlimited
LEAN=$1
export LEAN_PATH=../../../library/standard:.
export LEAN_PATH=../../../library:.
if [ $# -ne 3 ]; then
INTERACTIVE=no
else

View file

@ -5,7 +5,7 @@ if [ $# -ne 2 ]; then
fi
ulimit -s 8192
LEAN=$1
export LEAN_PATH=../../../library/standard:.
export LEAN_PATH=../../../library:.
f=$2
echo "-- testing $f"
if $LEAN $f; then

View file

@ -5,7 +5,7 @@ if [ $# -ne 2 ]; then
fi
ulimit -s 8192
LEAN=$1
export LEAN_PATH=../../../library/standard:.
export LEAN_PATH=../../../library:.
f=$2
echo "-- testing $f"
if $LEAN $f; then

View file

@ -5,7 +5,7 @@ if [ $# -ne 2 -a $# -ne 1 ]; then
fi
ulimit -s 8192
LEAN=$1
export LEAN_PATH=../../library/standard:.
export LEAN_PATH=../../library:.
if [ $# -ne 2 ]; then
INTERACTIVE=no
else

View file

@ -5,7 +5,7 @@ if [ $# -ne 3 -a $# -ne 2 ]; then
fi
ulimit -s 8192
LEAN=$1
export LEAN_PATH=../../library/standard:.
export LEAN_PATH=../../library:.
if [ $# -ne 3 ]; then
INTERACTIVE=no
else