Skip to content

Allow For Running Monkey Files #2

@michohl

Description

@michohl

Summary

The main.go should be modified to take an optional input which would be a file name.

If the file name is specified then we should try to run the monkey file instead of dropping to a REPL.

If no file is specified then drop the user into a normal REPL.

Desired Behavior

$ go run main.go
Hello michohl! This is the Monkey programming language!
Feel free to type in commands
>>

my_script.my

let x = 2
let y = 3
puts(x * y)
$ go run main.go my_script.my
6

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions