Added note suggesting using the compatibility mode if errors occur.
This commit is contained in:
parent
002f875c53
commit
17985e3b5a
22
app/main.cpp
22
app/main.cpp
@ -5,6 +5,7 @@
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <pddlparse/AST.h>
|
||||
#include <pddlparse/Exception.h>
|
||||
#include <pddlparse/Mode.h>
|
||||
#include <pddlparse/Parse.h>
|
||||
|
||||
@ -96,6 +97,13 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const auto printCompatibilityInfo =
|
||||
[&]()
|
||||
{
|
||||
if (parsingMode != pddl::Mode::Compatibility)
|
||||
logger.log(plasp::output::Priority::Info, "try using --parsing-mode=compatibility for extended legacy feature support");
|
||||
};
|
||||
|
||||
const auto colorPolicy = variablesMap["color"].as<std::string>();
|
||||
|
||||
if (colorPolicy == "auto")
|
||||
@ -190,6 +198,20 @@ int main(int argc, char **argv)
|
||||
catch (const tokenize::TokenizerException &e)
|
||||
{
|
||||
logger.log(plasp::output::Priority::Error, e.location(), e.message().c_str());
|
||||
|
||||
printCompatibilityInfo();
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const pddl::ParserException &e)
|
||||
{
|
||||
if (e.location())
|
||||
logger.log(plasp::output::Priority::Error, e.location().value(), e.message().c_str());
|
||||
else
|
||||
logger.log(plasp::output::Priority::Error, e.message().c_str());
|
||||
|
||||
printCompatibilityInfo();
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const plasp::output::TranslatorException &e)
|
||||
|
Reference in New Issue
Block a user