Add REPL boilerplate.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
dcf5cb336a
commit
04dfd62600
2 changed files with 45 additions and 0 deletions
19
cmd/repl/main.go
Normal file
19
cmd/repl/main.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue