fix(frontends/lean/parser): generate flycheck-friendly import error

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-31 19:03:54 -07:00
parent 6ca80b5000
commit c01b4bd636

View file

@ -1067,6 +1067,13 @@ void parser::parse_imports() {
} else if (auto it = find_file(f, ".olean")) { } else if (auto it = find_file(f, ".olean")) {
olean_files.push_back(f); olean_files.push_back(f);
} else { } else {
m_found_errors = true;
if (!m_use_exceptions && m_show_errors) {
flycheck_error err(regular_stream());
display_error_pos(pos());
regular_stream() << " invalid import, unknown module '" << f << "'" << endl;
}
if (m_use_exceptions)
throw parser_error(sstream() << "invalid import, unknown module '" << f << "'", pos()); throw parser_error(sstream() << "invalid import, unknown module '" << f << "'", pos());
} }
next(); next();