[commit: ghc] wip/T16185: Refactor GHCi UI to fix #11606, #12091, #15721, #16096 (a34ee61)
git at git.haskell.org
git at git.haskell.org
Tue Jan 15 17:43:13 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T16185
Link : http://ghc.haskell.org/trac/ghc/changeset/a34ee61545930d569d0dbafb3a4a5db3a7a711e5/ghc
>---------------------------------------------------------------
commit a34ee61545930d569d0dbafb3a4a5db3a7a711e5
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Wed Jan 9 18:44:48 2019 +0300
Refactor GHCi UI to fix #11606, #12091, #15721, #16096
Instead of parsing and executing a statement or declaration directly we
now parse them first and then execute in a separate step. This gives us
the flexibility to inspect the parsed declaration before execution.
Using this we now inspect parsed declarations, and if it's a single
declaration of form `x = y` we execute it as `let x = y` instead, fixing
a ton of problems caused by poor declaration support in GHCi.
To avoid any users of the modules I left `execStmt` and `runDecls`
unchanged and added `execStmt'` and `runDecls'` which work on parsed
statements/declarations.
>---------------------------------------------------------------
a34ee61545930d569d0dbafb3a4a5db3a7a711e5
compiler/deSugar/Desugar.hs | 19 +----
compiler/main/GHC.hs | 4 +-
compiler/main/HscMain.hs | 18 ++++-
compiler/main/HscTypes.hs | 12 +--
compiler/main/InteractiveEval.hs | 54 ++++++++++----
ghc/GHCi/UI.hs | 101 +++++++++++++++++++-------
ghc/GHCi/UI/Monad.hs | 22 ++++--
testsuite/tests/ghci/scripts/T11606.script | 5 ++
testsuite/tests/ghci/scripts/T11606.stderr | 12 +++
testsuite/tests/ghci/scripts/T16089.script | 4 +
testsuite/tests/ghci/scripts/T16089.stdout | 3 +
testsuite/tests/ghci/scripts/all.T | 4 +-
testsuite/tests/ghci/should_run/T12525.stdout | 2 +-
testsuite/tests/ghci/should_run/T16096.script | 4 +
testsuite/tests/ghci/should_run/T16096.stdout | 56 ++++++++++++++
testsuite/tests/ghci/should_run/all.T | 2 +
16 files changed, 246 insertions(+), 76 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a34ee61545930d569d0dbafb3a4a5db3a7a711e5
More information about the ghc-commits
mailing list