Skip to content

Commit

Permalink
Merge pull request #1 from SergMariaDB/main
Browse files Browse the repository at this point in the history
Keep context and continue work on exception
  • Loading branch information
ohhmm authored Feb 26, 2023
2 parents 16d81d1 + d85aff2 commit 9117f0b
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions libskrypt/skrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,28 @@ using namespace omnn::math;
bool Skrypt::Add(std::string_view line) {
Valuable v(line, varHost);
v.CollectVaNames(vars);
auto ok = v.IsVa();
if (ok) {
auto solutions = Solve(v.as<Variable>());
for (auto& solution : solutions) {
std::cout << ' ' << solution;
}
std::cout << std::endl;
}
else {
std::cout << v << std::endl;
ok = base::Add(std::move(v));
}
bool ok = {};
try
{
if (v.IsVa()) {
auto solutions = Solve(v.as<Variable>());
for (auto& solution : solutions) {
std::cout << ' ' << solution;
}
std::cout << std::endl;
ok = true;
}
else {
std::cout << v << std::endl;
ok = base::Add(std::move(v));
}
}
catch(...)
{
if (!ok) {
std::cout << "Please, consider improving the system to make this request" << std::endl;
}
}
return ok;
}

Expand Down

0 comments on commit 9117f0b

Please sign in to comment.