Don't require available library to run REPL or decoder
This commit is contained in:
parent
3b833ca75b
commit
33c2119708
@ -45,7 +45,7 @@ tricu > 12
|
|||||||
|
|
||||||
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases)
|
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases)
|
||||||
|
|
||||||
Or you can easily build and/or run this project using [Nix](https://nixos.org/download/).
|
Or you can easily build and run this project using [Nix](https://nixos.org/download/).
|
||||||
|
|
||||||
- Quick Start (REPL):
|
- Quick Start (REPL):
|
||||||
- `nix run git+https://git.eversole.co/James/tricu`
|
- `nix run git+https://git.eversole.co/James/tricu`
|
||||||
|
@ -60,8 +60,7 @@ main = do
|
|||||||
Repl -> do
|
Repl -> do
|
||||||
putStrLn "Welcome to the tricu REPL"
|
putStrLn "Welcome to the tricu REPL"
|
||||||
putStrLn "You can exit with `CTRL+D` or the `:_exit` command.`"
|
putStrLn "You can exit with `CTRL+D` or the `:_exit` command.`"
|
||||||
library <- liftIO $ evaluateFile "./lib/base.tri"
|
repl Map.empty
|
||||||
repl $ Map.delete "!result" library
|
|
||||||
Evaluate { file = filePaths, form = form } -> do
|
Evaluate { file = filePaths, form = form } -> do
|
||||||
result <- case filePaths of
|
result <- case filePaths of
|
||||||
[] -> do
|
[] -> do
|
||||||
@ -77,8 +76,7 @@ main = do
|
|||||||
value <- case filePaths of
|
value <- case filePaths of
|
||||||
[] -> getContents
|
[] -> getContents
|
||||||
(filePath:_) -> readFile filePath
|
(filePath:_) -> readFile filePath
|
||||||
library <- liftIO $ evaluateFile "./lib/base.tri"
|
putStrLn $ decodeResult $ result $ evalTricu Map.empty $ parseTricu value
|
||||||
putStrLn $ decodeResult $ result $ evalTricu library $ parseTricu value
|
|
||||||
|
|
||||||
runTricu :: String -> T
|
runTricu :: String -> T
|
||||||
runTricu input =
|
runTricu input =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user