From 17985e3b5a84fcc8efe4485d572f58709d9f4a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Wed, 21 Jun 2017 03:07:09 +0200 Subject: [PATCH] Added note suggesting using the compatibility mode if errors occur. --- app/main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index 6930f99..02c804e 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -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(); 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)