[commit: ghc] master: Lexer: Suggest adding 'let' on unexpected '=' token (0d6c97b)
git at git.haskell.org
git at git.haskell.org
Tue Jun 16 18:03:43 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0d6c97ba1267a53825809f3c99364f7aa38f0847/ghc
>---------------------------------------------------------------
commit 0d6c97ba1267a53825809f3c99364f7aa38f0847
Merge: df63736 1ff7f09
Author: Ben Gamari <ben at smart-cactus.org>
Date: Tue Jun 16 20:04:02 2015 +0200
Lexer: Suggest adding 'let' on unexpected '=' token
Summary:
I've heard numerous fledgling Haskeller's complain about the behavior of
ghci regarding bindings. While most REPLs accept bindings of the form
`x = 42`, GHCi is implicitly a `do` block, meaning that the user must
know to use a `let` to introduce a binding.
Here we suggest to the user that they may need a `let` and give them a
small example in the event that we find an unexpected `=` token.
Reviewers: austin
Reviewed By: austin
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D980
>---------------------------------------------------------------
0d6c97ba1267a53825809f3c99364f7aa38f0847
compiler/parser/Lexer.x | 3 +++
testsuite/tests/ghci/should_run/T9915.stderr | 5 ++++-
testsuite/tests/parser/should_fail/readFail011.stderr | 5 ++++-
testsuite/tests/parser/should_fail/readFail034.stderr | 5 ++++-
4 files changed, 15 insertions(+), 3 deletions(-)
More information about the ghc-commits
mailing list