Make 'builtins' available in the repl
This commit is contained in:
parent
c54bf53df6
commit
582a2b0a76
|
@ -45,7 +45,7 @@ main = do
|
||||||
opts <- execParser (nixOptionsInfo time)
|
opts <- execParser (nixOptionsInfo time)
|
||||||
runLazyM opts $ case readFrom opts of
|
runLazyM opts $ case readFrom opts of
|
||||||
Just path -> do
|
Just path -> do
|
||||||
let file = addExtension (dropExtension path) "nix"
|
let file = addExtension (dropExtension path) "nixc"
|
||||||
process opts (Just file) =<< liftIO (readCache path)
|
process opts (Just file) =<< liftIO (readCache path)
|
||||||
Nothing -> case expression opts of
|
Nothing -> case expression opts of
|
||||||
Just s -> handleResult opts Nothing (parseNixTextLoc s)
|
Just s -> handleResult opts Nothing (parseNixTextLoc s)
|
||||||
|
@ -57,7 +57,7 @@ main = do
|
||||||
mapM_ (processFile opts)
|
mapM_ (processFile opts)
|
||||||
=<< (lines <$> liftIO (readFile path))
|
=<< (lines <$> liftIO (readFile path))
|
||||||
Nothing -> case filePaths opts of
|
Nothing -> case filePaths opts of
|
||||||
[] -> Repl.shell (pure ())
|
[] -> withNixContext Nothing $ Repl.shell (pure ())
|
||||||
["-"] ->
|
["-"] ->
|
||||||
handleResult opts Nothing . parseNixTextLoc
|
handleResult opts Nothing . parseNixTextLoc
|
||||||
=<< liftIO Text.getContents
|
=<< liftIO Text.getContents
|
||||||
|
@ -92,7 +92,8 @@ main = do
|
||||||
errorWithoutStackTrace . show
|
errorWithoutStackTrace . show
|
||||||
=<< renderFrames @(NThunk (Lazy IO)) frames
|
=<< renderFrames @(NThunk (Lazy IO)) frames
|
||||||
|
|
||||||
when (repl opts) $ Repl.shell (pure ())
|
when (repl opts) $
|
||||||
|
withNixContext Nothing $ Repl.shell (pure ())
|
||||||
|
|
||||||
process opts mpath expr
|
process opts mpath expr
|
||||||
| evaluate opts, tracing opts =
|
| evaluate opts, tracing opts =
|
||||||
|
|
Loading…
Reference in a new issue