blob: 3f2bdbecb15f6681db63121dc28a9d7ef635a689 [file] [log] [blame]
#pragma once
#include <QString>
#include <QList>
#include "Evaluator.h"
#include "AstNode.h"
#include "Parser.h"
class Repl
{
public:
Repl();
void start();
char *prompt();
protected:
QString readLine();
void addHistory(QString line);
ParseResult trySpecialCase(QString line);
ParseResult tryEvaluate(Parser &parser, QList<AstNode> *expr);
Evaluator _eval;
bool _running = true;
};