| 51 | } |
| 52 | |
| 53 | void Interactive::execCommand(const QString& str) |
| 54 | { |
| 55 | try { |
| 56 | QString s(str); |
| 57 | if(isExpression(s)) { |
| 58 | s=QString("writeln(%1);").arg(s); |
| 59 | /* Use a kludge factor so that the reporter doesn't include the 'write(' |
| 60 | * characters in its 'at character' output */ |
| 61 | reporter.setKludge(-8); |
| 62 | } else { |
| 63 | reporter.setKludge(0); |
| 64 | } |
| 65 | |
| 66 | Script sc(reporter); |
| 67 | sc.parse(s); |
| 68 | TreeEvaluator e(reporter); |
| 69 | sc.accept(e); |
| 70 | Node* n=e.getRootNode(); |
| 71 | output.flush(); |
| 72 | delete n; |
| 73 | #ifdef USE_CGAL |
| 74 | } catch(const CGAL::Failure_exception& e) { |
| 75 | reporter.reportException(QString::fromStdString(e.what())); |
| 76 | #endif |
| 77 | } catch(const AssertException& e) { |
| 78 | reporter.reportMessage(e.getMessage()); |
| 79 | } catch(...) { |
| 80 | reporter.reportException(tr("Unknown error.")); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | static constexpr auto PROMPT="\u042F: "; |
| 85 |
nothing calls this directly
no test coverage detected