From 7a319dc03bfbbc999e44946d81fe38a70ac393fb Mon Sep 17 00:00:00 2001 From: tijani Date: Sun, 7 Aug 2022 14:43:06 +0000 Subject: [PATCH] not needed, at least for now git-svn-id: https://svn.tlawal.org/svn/monkey@43 f6afcba9-9ef1-4bdd-9b72-7484f5705bac --- debug.rdbg | Bin 243 -> 0 bytes repl/repl.go | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 debug.rdbg diff --git a/debug.rdbg b/debug.rdbg deleted file mode 100644 index 9e53659f4af7495b84e885b5536e8f4e99852c46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmWG?adH=8U|?{uipkB-%TBF~$xY16(@U*L1qy-zBajpXVl)-$`5*}pz^OnOA`ey| h{Vm)BrU9-C#9)Ui!bO2J!7wg0U~#Y_4!lYrk^m{D7V`iA diff --git a/repl/repl.go b/repl/repl.go index e69e5ae..d2f8efe 100644 --- a/repl/repl.go +++ b/repl/repl.go @@ -6,6 +6,7 @@ import ( "io" "monkey/lexer" "monkey/parser" + "monkey/evaluator" ) const MONKEY_FACE = ` __,__ @@ -42,9 +43,12 @@ func Start(in io.Reader, out io.Writer) { print_parser_errors(out, l_parser.Errors()) continue } - - io.WriteString(out, program.String()) - io.WriteString(out, "\n") + + evaluated := evaluator.Eval(program) + if evaluated != nil{ + io.WriteString(out, evaluated.Inspect()) + io.WriteString(out, "\n") + } } }