Fixes identifier lexing; support REPL file loading
This commit is contained in:
10
src/REPL.hs
10
src/REPL.hs
@ -1,6 +1,7 @@
|
||||
module REPL where
|
||||
|
||||
import Eval
|
||||
import FileEval
|
||||
import Lexer
|
||||
import Parser
|
||||
import Research
|
||||
@ -21,6 +22,15 @@ repl env = runInputT defaultSettings (loop env)
|
||||
case minput of
|
||||
Nothing -> outputStrLn "Goodbye!"
|
||||
Just ":_exit" -> outputStrLn "Goodbye!"
|
||||
Just ":_load" -> do
|
||||
path <- getInputLine "File path to load < "
|
||||
case path of
|
||||
Nothing -> do
|
||||
outputStrLn "No input received; stopping import."
|
||||
loop env
|
||||
Just path -> do
|
||||
loadedEnv <- liftIO $ evaluateFileEnv path
|
||||
loop $ Map.union loadedEnv env
|
||||
Just "" -> do
|
||||
outputStrLn ""
|
||||
loop env
|
||||
|
Reference in New Issue
Block a user