chore(*): compilation errors, fix style, fix warnings
This commit is contained in:
parent
14f8093181
commit
d40e97b4bc
19 changed files with 60 additions and 53 deletions
|
|
@ -20,9 +20,7 @@ lean_bool lean_parse_file(lean_env env, lean_ios ios, char const * fname, lean_e
|
|||
check_nonnull(fname);
|
||||
environment _env = to_env_ref(env);
|
||||
io_state _ios = to_io_state_ref(ios);
|
||||
bool use_exceptions = true;
|
||||
unsigned num_threads = 1;
|
||||
parse_commands(_env, _ios, fname, optional<std::string>(), use_exceptions, num_threads);
|
||||
parse_commands(_env, _ios, fname);
|
||||
*new_env = of_env(new environment(_env));
|
||||
*new_ios = of_io_state(new io_state(_ios));
|
||||
LEAN_CATCH;
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ Author: Leonardo de Moura
|
|||
#include <vector>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "frontends/lean/info_manager.h"
|
||||
#include "util/lean_path.h"
|
||||
#include "library/choice.h"
|
||||
#include "library/scoped_ext.h"
|
||||
#include "library/pp_options.h"
|
||||
#include "frontends/lean/json.h"
|
||||
#include "frontends/lean/info_manager.h"
|
||||
|
||||
namespace lean {
|
||||
class type_info_data : public info_data_cell {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ Author: Leonardo de Moura
|
|||
#include <string>
|
||||
#include "kernel/expr.h"
|
||||
#include "library/io_state_stream.h"
|
||||
#include "frontends/lean/json.h"
|
||||
#include "library/metavar_context.h"
|
||||
#include "library/tactic/tactic_state.h"
|
||||
#include "frontends/lean/json.h"
|
||||
|
||||
namespace lean {
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ Author: Leonardo de Moura
|
|||
#include <limits>
|
||||
#include <vector>
|
||||
#include "util/utf8.h"
|
||||
#include <library/export_decl.h>
|
||||
#include "library/st_task_queue.h"
|
||||
#include "library/module_mgr.h"
|
||||
#include "util/interrupt.h"
|
||||
#include "util/sstream.h"
|
||||
#include "util/flet.h"
|
||||
|
|
@ -23,6 +20,8 @@ Author: Leonardo de Moura
|
|||
#include "kernel/abstract.h"
|
||||
#include "kernel/instantiate.h"
|
||||
#include "kernel/error_msgs.h"
|
||||
#include "library/st_task_queue.h"
|
||||
#include "library/module_mgr.h"
|
||||
#include "library/export_decl.h"
|
||||
#include "library/trace.h"
|
||||
#include "library/exception.h"
|
||||
|
|
@ -2054,6 +2053,10 @@ void parser::reset_doc_string() {
|
|||
m_doc_string = optional<std::string>();
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
|
||||
std::vector<module_name> parser::parse_imports(unsigned & fingerprint) {
|
||||
m_last_cmd_pos = pos();
|
||||
bool prelude = false;
|
||||
|
|
@ -2070,19 +2073,25 @@ std::vector<module_name> parser::parse_imports(unsigned & fingerprint) {
|
|||
next();
|
||||
while (true) {
|
||||
optional<unsigned> k;
|
||||
unsigned h = 0;
|
||||
while (true) {
|
||||
if (curr_is_token(get_period_tk())) {
|
||||
next();
|
||||
if (!k)
|
||||
if (!k) {
|
||||
k = 0;
|
||||
else
|
||||
} else {
|
||||
k = *k + 1;
|
||||
h++;
|
||||
}
|
||||
} else if (curr_is_token(get_ellipsis_tk())) {
|
||||
next();
|
||||
if (!k)
|
||||
if (!k) {
|
||||
k = 2;
|
||||
else
|
||||
h = 2;
|
||||
} else {
|
||||
k = *k + 3;
|
||||
h += 3;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
@ -2091,8 +2100,9 @@ std::vector<module_name> parser::parse_imports(unsigned & fingerprint) {
|
|||
break;
|
||||
name f = get_name_val();
|
||||
fingerprint = hash(fingerprint, f.hash());
|
||||
if (k)
|
||||
fingerprint = hash(fingerprint, *k);
|
||||
if (k) {
|
||||
fingerprint = hash(fingerprint, h);
|
||||
}
|
||||
imports.push_back({ f, k });
|
||||
next();
|
||||
}
|
||||
|
|
@ -2262,8 +2272,7 @@ message_builder parser::mk_message(message_severity severity) {
|
|||
return mk_message(pos(), severity);
|
||||
}
|
||||
|
||||
bool parse_commands(environment & env, io_state & ios, char const * fname, optional<std::string> const & base_dir,
|
||||
bool use_exceptions, unsigned num_threads) {
|
||||
bool parse_commands(environment & env, io_state & ios, char const * fname) {
|
||||
st_task_queue tq;
|
||||
scope_global_task_queue scope(&tq);
|
||||
fs_module_vfs vfs;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ Author: Leonardo de Moura
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "library/module.h"
|
||||
#include "util/flet.h"
|
||||
#include "util/name_map.h"
|
||||
#include "util/exception.h"
|
||||
#include "library/task_queue.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "kernel/expr_maps.h"
|
||||
#include "library/module.h"
|
||||
#include "library/task_queue.h"
|
||||
#include "library/abstract_parser.h"
|
||||
#include "library/io_state.h"
|
||||
#include "library/io_state_stream.h"
|
||||
|
|
@ -502,8 +502,7 @@ public:
|
|||
virtual char const * get_file_name() const override;
|
||||
};
|
||||
|
||||
bool parse_commands(environment & env, io_state & ios, char const * fname, optional<std::string> const & base,
|
||||
bool use_exceptions, unsigned num_threads);
|
||||
bool parse_commands(environment & env, io_state & ios, char const * fname);
|
||||
|
||||
void initialize_parser();
|
||||
void finalize_parser();
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#include <library/task_queue.h>
|
||||
#include "kernel/declaration.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "kernel/for_each_fn.h"
|
||||
// TODO(gebner, leo): kernel should not depend on library folder
|
||||
#include "library/task_queue.h"
|
||||
|
||||
namespace lean {
|
||||
int compare(reducibility_hints const & h1, reducibility_hints const & h2) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#pragma once
|
||||
#include "kernel/environment.h"
|
||||
|
||||
namespace lean {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
|
||||
Author: Gabriel Ebner
|
||||
*/
|
||||
#include <string>
|
||||
#include "library/message_builder.h"
|
||||
#include "library/type_context.h"
|
||||
#include "library/message_buffer.h"
|
||||
#include <string>
|
||||
|
||||
namespace lean {
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ Author: Leonardo de Moura
|
|||
#include <vector>
|
||||
#include "util/serializer.h"
|
||||
#include "util/optional.h"
|
||||
#include "kernel/pos_info_provider.h"
|
||||
#include "kernel/inductive/inductive.h"
|
||||
#include "library/io_state.h"
|
||||
#include "library/task_queue.h"
|
||||
#include "kernel/pos_info_provider.h"
|
||||
|
||||
namespace lean {
|
||||
class corrupted_file_exception : public exception {
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ Author: Gabriel Ebner
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include "library/module_mgr.h"
|
||||
#include <sys/stat.h>
|
||||
#include "util/lean_path.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
#include "util/file_lock.h"
|
||||
#include "library/module_mgr.h"
|
||||
#include "library/module.h"
|
||||
#include "library/versioned_msg_buf.h"
|
||||
#include <sys/stat.h>
|
||||
#include <frontends/lean/pp.h>
|
||||
#include <util/file_lock.h>
|
||||
#include "frontends/lean/pp.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
|
||||
namespace lean {
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ snapshot_vector module_mgr::get_snapshots(module_id const & id) {
|
|||
}
|
||||
|
||||
bool
|
||||
module_mgr::get_snapshots_or_unchanged_module(module_id const &id, std::string const &contents, time_t mtime,
|
||||
module_mgr::get_snapshots_or_unchanged_module(module_id const &id, std::string const &contents, time_t /* mtime */,
|
||||
snapshot_vector &vector) {
|
||||
if (!m_modules.count(id)) return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ Author: Gabriel Ebner
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <util/name.h>
|
||||
#include <kernel/environment.h>
|
||||
#include <library/task_queue.h>
|
||||
#include <unordered_map>
|
||||
#include "frontends/lean/parser.h"
|
||||
#include "util/name.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "library/task_queue.h"
|
||||
#include "library/message_buffer.h"
|
||||
#include "library/io_state.h"
|
||||
#include "library/trace.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
|
||||
namespace lean {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class mt_task_queue : public task_queue {
|
|||
struct worker_info {
|
||||
thread m_thread;
|
||||
generic_task_result m_current_task;
|
||||
atomic<bool> * m_interrupt_flag = nullptr;
|
||||
atomic_bool * m_interrupt_flag = nullptr;
|
||||
};
|
||||
std::vector<std::shared_ptr<worker_info>> m_workers;
|
||||
bool m_shutting_down = false;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Author: Gabriel Ebner
|
|||
#include <utility>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <util/name_set.h>
|
||||
#include "util/name_set.h"
|
||||
#include "library/versioned_msg_buf.h"
|
||||
#include "frontends/lean/info_manager.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ Author: Gabriel Ebner
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include "library/message_buffer.h"
|
||||
#include "util/name.h"
|
||||
#include "library/message_buffer.h"
|
||||
#include "frontends/lean/info_manager.h"
|
||||
|
||||
namespace lean {
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@ Author: Leonardo de Moura
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <library/st_task_queue.h>
|
||||
#include <library/mt_task_queue.h>
|
||||
#include "library/module_mgr.h"
|
||||
#include "util/realpath.h"
|
||||
#include "util/stackinfo.h"
|
||||
#include "util/macros.h"
|
||||
|
|
@ -31,6 +28,9 @@ Author: Leonardo de Moura
|
|||
#include "kernel/kernel_exception.h"
|
||||
#include "kernel/type_checker.h"
|
||||
#include "kernel/formatter.h"
|
||||
#include "library/st_task_queue.h"
|
||||
#include "library/mt_task_queue.h"
|
||||
#include "library/module_mgr.h"
|
||||
#include "library/standard_kernel.h"
|
||||
#include "library/module.h"
|
||||
#include "library/type_context.h"
|
||||
|
|
|
|||
|
|
@ -10,20 +10,20 @@ Authors: Gabriel Ebner, Leonardo de Moura, Sebastian Ullrich
|
|||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <clocale>
|
||||
#include "util/sexpr/option_declarations.h"
|
||||
#include "util/bitap_fuzzy_search.h"
|
||||
#include "kernel/instantiate.h"
|
||||
#include "library/mt_task_queue.h"
|
||||
#include "library/st_task_queue.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
#include "library/module.h"
|
||||
#include "shell/server.h"
|
||||
#include "frontends/lean/info_manager.h"
|
||||
#include "frontends/lean/definition_cmds.h"
|
||||
#include "util/sexpr/option_declarations.h"
|
||||
#include "frontends/lean/util.h"
|
||||
#include "library/protected.h"
|
||||
#include "library/scoped_ext.h"
|
||||
#include "util/bitap_fuzzy_search.h"
|
||||
#include "library/type_context.h"
|
||||
#include "kernel/instantiate.h"
|
||||
#include "library/module.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
#include "frontends/lean/info_manager.h"
|
||||
#include "frontends/lean/definition_cmds.h"
|
||||
#include "frontends/lean/util.h"
|
||||
#include "shell/server.h"
|
||||
|
||||
#ifndef LEAN_DEFAULT_AUTO_COMPLETION_MAX_RESULTS
|
||||
#define LEAN_DEFAULT_AUTO_COMPLETION_MAX_RESULTS 100
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
Authors: Gabriel Ebner, Sebastian Ullrich
|
||||
*/
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "kernel/pos_info_provider.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "library/io_state.h"
|
||||
#include "frontends/lean/json.h"
|
||||
#include <string>
|
||||
#include "library/versioned_msg_buf.h"
|
||||
#include "library/module_mgr.h"
|
||||
#include "frontends/lean/json.h"
|
||||
|
||||
namespace lean {
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void sleep_for(unsigned ms, unsigned step_ms) {
|
|||
check_interrupted();
|
||||
}
|
||||
|
||||
atomic<bool> *get_interrupt_flag() {
|
||||
atomic_bool * get_interrupt_flag() {
|
||||
return &get_g_interrupt();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ Author: Leonardo de Moura
|
|||
#include "util/exception.h"
|
||||
|
||||
namespace lean {
|
||||
|
||||
atomic<bool> * get_interrupt_flag();
|
||||
atomic_bool * get_interrupt_flag();
|
||||
|
||||
/**
|
||||
\brief Mark flag for interrupting current thread.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue