Skip to content
Snippets Groups Projects
Commit 41178564 authored by Martin Hanzik's avatar Martin Hanzik Committed by Jan Trávníček
Browse files

Simplify Converter::parseText

parent 4d1ba357
No related branches found
No related tags found
No related merge requests found
...@@ -116,26 +116,17 @@ namespace Converter { ...@@ -116,26 +116,17 @@ namespace Converter {
   
std::vector<bool> moves; std::vector<bool> moves;
moves.push_back(true); moves.push_back(true);
try { for (const auto& type: { "automaton::Automaton", "grammar::Grammar"}) {
return abstraction::AlgorithmHelper::eval("string::Parse", try {
{"automaton::Automaton"}, return abstraction::AlgorithmHelper::eval("string::Parse",
params, {type},
moves, params,
abstraction::AlgorithmCategories::AlgorithmCategory::DEFAULT); moves,
} abstraction::AlgorithmCategories::AlgorithmCategory::DEFAULT);
catch (const exception::CommonException& e) { }
} catch (const exception::CommonException& e) {}
try {
return abstraction::AlgorithmHelper::eval("string::Parse",
{"grammar::Grammar"},
params,
moves,
abstraction::AlgorithmCategories::AlgorithmCategory::DEFAULT);
}
catch (const exception::CommonException& e) {
return nullptr;
} }
return nullptr;
} }
   
std::shared_ptr<abstraction::OperationAbstraction> tryParse(const QString& input) { std::shared_ptr<abstraction::OperationAbstraction> tryParse(const QString& input) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment