blob: 5d6bf6ac430684f0c032ff07ce5ede82c54cfc73 [file] [log] [blame]
#include "StdLib.h"
#include "PPrint.h"
StdLib::StdLib()
{
_print.addNativeSentence("e.Expr", [](VarContext args)
{
auto expr = args.expressionVar("Expr");
sout(pprint(args.expressionVar("Expr")));
return expr;
});
_prout.addNativeSentence("e.Expr", [](VarContext args)
{
auto expr = args.expressionVar("Expr");
sout(pprint(expr));
return QList<Token>();
});
}
void StdLib::load(Evaluator &eval)
{
eval.addFunction(_print);
eval.addFunction(_prout);
}