Add parseExpr and compileParsedExpr and use them in GHC API and GHCi
authorSimon Marlow <marlowsd@gmail.com>
Fri, 12 Jun 2015 12:15:18 +0000 (13:15 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 12 Jun 2015 12:15:18 +0000 (13:15 +0100)
commitd20031d4c88b256cdae264cb05d9d850e973d956
tree84af3e055d60d87058cfe48a7260e75859f9fefe
parentc14bd01756ffaf3a0bf34c766cfc1d611dba0dc4
Add parseExpr and compileParsedExpr and use them in GHC API and GHCi

Summary:
This commit brings following changes and fixes:

 * Implement parseExpr and compileParsedExpr;
 * Fix compileExpr and dynCompilerExpr, which returned `()` for empty expr;
 * Fix :def and :cmd, which didn't work if `IO` or `String` is not in scope;
 * Use GHCiMonad instead IO in :def and :cmd;
 * Clean PrelInfo: delete dead comment and duplicate entries, add assertion.

See new tests for more details.

Test Plan: ./validate

Reviewers: austin, dterei, simonmar

Reviewed By: simonmar

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D974

GHC Trac Issues: #10508
15 files changed:
compiler/main/GHC.hs
compiler/main/HscMain.hs
compiler/main/InteractiveEval.hs
compiler/prelude/PrelInfo.hs
compiler/prelude/PrelNames.hs
ghc/InteractiveUI.hs
testsuite/.gitignore
testsuite/tests/ghc-api/T10508_api.hs [new file with mode: 0644]
testsuite/tests/ghc-api/T10508_api.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/T10508_api.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/all.T
testsuite/tests/ghci/scripts/T10508.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T10508.stderr [new file with mode: 0644]
testsuite/tests/ghci/scripts/T10508.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T