Add REPL boilerplate.

Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
Mariano Uvalle 2025-01-02 17:18:00 -08:00
parent dcf5cb336a
commit 04dfd62600
2 changed files with 45 additions and 0 deletions

19
cmd/repl/main.go Normal file
View file

@ -0,0 +1,19 @@
package main
import (
"fmt"
"os"
"os/user"
"code.jmug.me/jmug/interpreter-in-go/pkg/repl"
)
func main() {
user, err := user.Current()
if err != nil {
panic(err)
}
fmt.Printf("Hello %s, this is the Monkey programming language!\n", user.Username)
fmt.Println("Go ahead, type something :)")
repl.Start(os.Stdin, os.Stdout)
}