private Macaca.Object TestEvaluate(string input) { var lexer = new Macaca.Lexer(input); var parser = new Macaca.Parser(lexer); var evaluator = new Macaca.Evaluator(parser.ParseProgram()); return(evaluator.Eval()); }
public void REPL() { var lexer = new Macaca.Lexer(mInputField.text); var parser = new Macaca.Parser(lexer); var evaluator = new Macaca.Evaluator(parser.ParseProgram()); var sb = new System.Text.StringBuilder(mInputField.text); sb.Append('\n'); sb.Append(evaluator.Eval().Inspect()); sb.Append('\n'); mInputField.text = sb.ToString(); }