aboutsummaryrefslogtreecommitdiff
path: root/repl
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-03-08 21:38:19 +0000
committerBobby <[email protected]>2024-03-08 21:38:19 +0000
commit87b188bae2c8a2a9f81e872805d072be7ec910b2 (patch)
treeb3c48ba591966e424b1bb55dba1f652733368a34 /repl
parentb52f4e9b4140f482ad966aa354b39cd305a212ec (diff)
downloadmana-87b188bae2c8a2a9f81e872805d072be7ec910b2.tar.xz
mana-87b188bae2c8a2a9f81e872805d072be7ec910b2.zip
ast: fn init
Diffstat (limited to 'repl')
-rw-r--r--repl/repl.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/repl/repl.go b/repl/repl.go
index 59c56d6..afee75e 100644
--- a/repl/repl.go
+++ b/repl/repl.go
@@ -4,10 +4,10 @@ import (
"bufio"
"fmt"
"io"
+ "mana/evaluator"
"mana/lexer"
+ "mana/object"
"mana/parser"
- "mana/evaluator"
- "mana/object"
)
// PROMPT is the prompt for the REPL.
@@ -19,13 +19,13 @@ const MANA_START = `
██║╚██╔╝██║██╔══██║██║╚████║██╔══██║
██║░╚═╝░██║██║░░██║██║░╚███║██║░░██║
╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝
-`
+`
func Start(in io.Reader, out io.Writer) {
var scanner *bufio.Scanner = bufio.NewScanner(in)
- env := object.NewEnvironment()
+ env := object.NewEnvironment()
- io.WriteString(out, MANA_START + "\n")
+ io.WriteString(out, MANA_START+"\n")
for {
fmt.Fprint(out, PROMPT)
@@ -57,6 +57,6 @@ func Start(in io.Reader, out io.Writer) {
func printParserErrors(out io.Writer, errors []string) {
io.WriteString(out, "ParseError:\n")
for _, msg := range errors {
- io.WriteString(out, "\t" + msg + "\n")
+ io.WriteString(out, "\t"+msg+"\n")
}
}