From 1ea1289b7a3f22914fb49092ad68241411abf3b6 Mon Sep 17 00:00:00 2001 From: tijani Date: Thu, 12 May 2022 22:39:29 +0000 Subject: [PATCH] READ-EVALUATE-PRINT-LOOP now works and spits out tokens of input. YAY!!! git-svn-id: https://svn.tlawal.org/svn/monkey@5 f6afcba9-9ef1-4bdd-9b72-7484f5705bac --- main.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..ec1a30b --- /dev/null +++ b/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "os" + "os/user" + + "monkey/repl" +) + +// TODO(tijani): add quit command. +func main() { + user, err := user.Current() + if err != nil { + panic(err) + } + + fmt.Printf("Hello %s! Welcome to the Monkey programming language!\n", user.Username) + repl.Start(os.Stdin, os.Stdout) +}