| 827 | } |
| 828 | |
| 829 | void StringParser::ProcessAbortCommand(const StringRef& reply) noexcept |
| 830 | { |
| 831 | #if SUPPORT_ASYNC_MOVES |
| 832 | if (!gb.Executing()) return; |
| 833 | #endif |
| 834 | |
| 835 | SkipWhiteSpace(); |
| 836 | if (gb.buffer[readPointer] != 0) |
| 837 | { |
| 838 | // If we fail to parse the expression, we want to abort anyway |
| 839 | try |
| 840 | { |
| 841 | ExpressionParser parser(&gb, gb.buffer + readPointer, gb.buffer + ARRAY_SIZE(gb.buffer), (int)commandIndent + readPointer); |
| 842 | const ExpressionValue val = parser.Parse(); |
| 843 | readPointer = parser.GetEndptr() - gb.buffer; |
| 844 | val.AppendAsString(reply); |
| 845 | } |
| 846 | catch (const GCodeException& e) |
| 847 | { |
| 848 | e.GetMessage(reply, &gb); |
| 849 | reply.Insert(0, "invalid expression after 'abort': "); |
| 850 | } |
| 851 | } |
| 852 | else |
| 853 | { |
| 854 | reply.copy("'abort' command executed"); |
| 855 | } |
| 856 | |
| 857 | reprap.GetGCodes().AbortPrint(gb); |
| 858 | } |
| 859 | |
| 860 | void StringParser::ProcessEchoCommand(const StringRef& reply) THROWS(GCodeException) |
| 861 | { |
nothing calls this directly
no test coverage detected