Make 'builtins' available in the repl

This commit is contained in:
John Wiegley 2018-08-04 17:34:50 -04:00
parent c54bf53df6
commit 582a2b0a76
No known key found for this signature in database
GPG Key ID: C144D8F4F19FE630
1 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,7 @@ main = do
opts <- execParser (nixOptionsInfo time)
runLazyM opts $ case readFrom opts of
Just path -> do
let file = addExtension (dropExtension path) "nix"
let file = addExtension (dropExtension path) "nixc"
process opts (Just file) =<< liftIO (readCache path)
Nothing -> case expression opts of
Just s -> handleResult opts Nothing (parseNixTextLoc s)
@ -57,7 +57,7 @@ main = do
mapM_ (processFile opts)
=<< (lines <$> liftIO (readFile path))
Nothing -> case filePaths opts of
[] -> Repl.shell (pure ())
[] -> withNixContext Nothing $ Repl.shell (pure ())
["-"] ->
handleResult opts Nothing . parseNixTextLoc
=<< liftIO Text.getContents
@ -92,7 +92,8 @@ main = do
errorWithoutStackTrace . show
=<< renderFrames @(NThunk (Lazy IO)) frames
when (repl opts) $ Repl.shell (pure ())
when (repl opts) $
withNixContext Nothing $ Repl.shell (pure ())
process opts mpath expr
| evaluate opts, tracing opts =