Provide "library" via tricu file directly
Allows easier loading of other files and drops the list of Haskell strings containing the basic tools included
This commit is contained in:
@ -2,11 +2,11 @@ module Main where
|
||||
|
||||
import Eval (evalTricu, result)
|
||||
import FileEval
|
||||
import Library (library)
|
||||
import Parser (parseTricu)
|
||||
import REPL
|
||||
import Research
|
||||
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Text.Megaparsec (runParser)
|
||||
import System.Console.CmdArgs
|
||||
|
||||
@ -68,10 +68,11 @@ main = do
|
||||
Repl -> do
|
||||
putStrLn "Welcome to the tricu REPL"
|
||||
putStrLn "You can exit with `CTRL+D` or the `:_exit` command.`"
|
||||
library <- liftIO $ evaluateFile "./lib/base.tri"
|
||||
repl library
|
||||
Evaluate { file = maybeFilePath, output = maybeOutputPath, form = form } -> do
|
||||
result <- case maybeFilePath of
|
||||
Just filePath -> evaluateFile filePath
|
||||
Just filePath -> evaluateFileResult filePath
|
||||
Nothing -> do
|
||||
t <- getContents
|
||||
pure $ runTricu t
|
||||
@ -85,6 +86,7 @@ main = do
|
||||
value <- case maybeFilePath of
|
||||
Just filePath -> readFile filePath
|
||||
Nothing -> getContents
|
||||
library <- liftIO $ evaluateFile "./lib/base.tri"
|
||||
putStrLn $ decodeResult $ result $ evalTricu library $ parseTricu value
|
||||
|
||||
runTricu :: String -> T
|
||||
|
Reference in New Issue
Block a user