Home
Phabricator
Search
Log In
Files
F5817994
lua_multiline_output.patch
asemke (Alexander Semke)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Author
asemke
Created
Apr 22 2018, 5:36 PM
Size
947 B
Mime Type
text/x-diff
Engine
blob
Format
Raw Data
Handle
3561975
Attached To
D12074: Solve problem of appearance input of interpreter in interpreter's output in Lua backend
lua_multiline_output.patch
View Options
diff --git a/src/backends/lua/luaexpression.cpp b/src/backends/lua/luaexpression.cpp
index 588c72bb..e7aadae5 100644
--- a/src/backends/lua/luaexpression.cpp
+++ b/src/backends/lua/luaexpression.cpp
@@ -67,9 +67,14 @@ void LuaExpression::parseError(QString &error)
void LuaExpression::parseOutput(QString &output)
{
- output.replace(command(), QLatin1String(""));
- output.replace(QLatin1String("return"), QLatin1String(""));
- output.replace(QLatin1String(">"), QLatin1String(""));
+ qDebug()<<"parsing the output " << output;
+
+ const QStringList& inputs = command().split(QLatin1Char('\n'));
+ for (const auto input : inputs)
+ output.remove(input + QLatin1Char('\n'));
+
+ output.remove(QLatin1String("return")); //TODO: what do we need this for?
+ output.remove(QLatin1String(">"));
output = output.trimmed();
qDebug() << "final output of the command " << command() << ": " << output << endl;
Log In to Comment