[GHC] #12483: Improve parse error message on indentation mistake
GHC
ghc-devs at haskell.org
Fri Aug 12 03:44:46 UTC 2016
#12483: Improve parse error message on indentation mistake
-------------------------------------+-------------------------------------
Reporter: harendra | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Other
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Consider the following code fragment:
{{{#!hs
(ExecGhc, args) -> execCompiler "" args
-- NOTE: this won't currently work for GHCJS, because
it doesn't have
-- a runghcjs binary. It probably will someday,
though.
(ExecRunGhc, args) ->
}}}
The last line is indented by one space but it is hard to notice esp when
we looking at this along with a screenful of code and there are many
comments between the two lines. When this code is compiled ghc throws the
following error:
{{{
Main.hs:745:40: error: parse error on input ‘->’
}}}
I look at the error and then the code and wonder what is wrong with this
code, there is nothing noticeably wrong. If ghc can provide some context I
can easily make out where the problem is. ghc can perhaps tell me how the
current expression is being parsed e.g. `(ExecRunGhc, args) ->` is being
considered as a continuation of the expression on the previous line.
I have run into this many times. The first time it was really frustrating.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12483>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list