#2507: quotation characters in error messages
--------------------------------+-------------------------------------------
Reporter: Isaac Dupree | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 6.8.3 | Severity: normal
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
--------------------------------+-------------------------------------------
(wasn't there a ticket for this already?)
Currently identifiers etc. are quoted like this, with the "grave accent"
and symmetric single-quote characters:
{{{
Ambiguous type variable `m' in the constraint:
`Monad m' arising from a use of `>>=' at gw.hs:6:47-71
}}}
This is not only an incorrect use of the "grave accent", but can be
confusing when an identifier-name contains the prime symbol which is the
same as the character used here to end the quote.
What should we do? Well, I just noticed that gcc-4.2.3 uses the Unicode
begin-single-quote and end-single-quote characters for the purpose (and it
actually looks quite nice on my terminal). If GCC was willing to do it,
perhaps we should be too! To be precise, it uses them in my default
locale, "en_US.UTF-8", which must have been the Ubuntu default that I
didn't even remember I had. With `env LANG=C`, GCC emits ASCII single-
quotes for both the begin and the end.
{{{
> cat errory.c
syntax error
> gcc errory.c
errory.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘error’
> env LANG=C gcc errory.c
errory.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'error'
}}}
I propose copying GCC's behavior (which might involve first looking into
exactly what its behavior is in the general case).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2507>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs