Add REPL history
diff --git a/Repl.cpp b/Repl.cpp
index 415602f..6137c19 100644
--- a/Repl.cpp
+++ b/Repl.cpp
@@ -44,16 +44,21 @@
return string;
}
+void Repl::addHistory(QString line)
+{
+ ReadLine::add_history(line.toUtf8());
+}
+
void Repl::start()
{
while (_running)
{
- QString line = readLine();
-
- line = line.trimmed();
+ QString line = readLine().trimmed();
QList<AstNode> expr;
+ addHistory(line);
+
if (trySpecialCase(line))
{}
else if (tryEvaluate(line, &expr))
@@ -80,7 +85,7 @@
if (okay)
{
- qDebug() << pprint(out);
+ qDebug().noquote() << pprint(out);
}
}
else