| 477 | } |
| 478 | |
| 479 | Result ValidateScript(const std::string& script) |
| 480 | { |
| 481 | try |
| 482 | { |
| 483 | auto exprs = Scripting::parseStatements(script); |
| 484 | if(exprs.empty()) |
| 485 | { |
| 486 | return nonstd::make_unexpected("Empty Script"); |
| 487 | } |
| 488 | return {}; |
| 489 | } |
| 490 | catch(RuntimeError& err) |
| 491 | { |
| 492 | return nonstd::make_unexpected(err.what()); |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | } // namespace BT |