Refactor SrcLoc and SrcSpan The "Unhelpful" cases are now in a separate type. This allows us to improve various things, e.g.: * Most of the panic's in SrcLoc are now gone * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it knows that it has real locations and thus can assume that the line number etc really exists * Some of the more suspicious cases are no longer necessary, e.g. we no longer need this case in advanceSrcLoc: advanceSrcLoc loc _ = loc -- Better than nothing More improvements can probably be made, e.g. tick locations can probably use RealSrcSpans too.
Tidy up the ic_exports field of the InteractiveContext. Previously was [(Module, Maybe ImportDecl)], now it is just [ImportDecl]. So now ":m +A" and "import A" do exactly the same thing in GHCi, and use the same code paths.
Start support for coloured SDoc output. The SDoc type now passes around an abstract SDocContext rather than just a PprStyle which required touching a few more files. This should also make it easier to integrate DynFlags passing, so that we can get rid of global variables.
Prefer builtin commands to macros in GHCi command resolution (#3858) Current precedence rules in GHCi are that: * User macros are *always* preferred in command resolution * User macros that are defined earlier are preferred to those that are defined earlier on * Builtin commands have lowest precedence However this caused user confusion because e.g. defining a macro beginning with "i" would override the standard :info command whenever the user typed the abbreviated command :i. The new precedence rules are based on the view that things defined earlier are always preferred to things defined later. The builtin commands are logically defined earliest of all (when GHCi starts) so they always take precedence.
Improve GHCi line numbers in errors When running commands from the user (as opposed to from a file), reset the line number to 1 at the start of each command.
:script file scripts in GHCi #1363 This patch adds the script command in GHCi A file is read and executed as a series of GHCi commands. Execution terminates on the first error. The filename and line number are included in the error.
Remove redundant import
Improve error message of :set in ghci (ticket #4190).
fix up multi-line GHCi patch (#4316)
multiline commands in GHCi #4316 This patch adds support for multiline commands in GHCi. The first line of input is lexed. If there is an active layout context once the lexer reaches the end of file, the user is prompted for more input. Multiline input is exited by an empty line and can be escaped with a user interrupt. Multiline mode is toggled with `:set +m`
Replace uses of the old try function with the new one
Replace uses of the old catch function with the new one
Create ~/.ghc/ if it doesn't already exist; fixes trac #4522
Remove more dead code now we require GHC >= 6.12
fix warnings
:unset settings support Added support for settings [args, prog, prompt, editor and stop]. Now :unset supports the same set of options as :set.
Close .ghci files after reading them; fixes trac #4487
Fix bug #3165 (:history throws irrefutable pattern failed) I ran across this bug and took the time to fix it, closing a long time due TODO in InteractiveEval.hs Instead of looking around to find the enclosing declaration of a tick, this patch makes use of the information already collected during the coverage desugaring phase
Remove no-longer-necessary withFlattenedDynflags
Use liftIO rather than io