#7671: No break spaces -----------------------------+---------------------------------------------- Reporter: zenzike | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- I thought I was going mad when the following code wasn't compiling: {{{ {-# LANGUAGE UnicodeSyntax #-} {-# LANGUAGE RankNTypes #-} type F f = forall x . f x }}} GHC was producing the following error message: {{{ mad.hs:4:21 Illegal symbol '.' in type Perhaps you intended -XRankNTypes or similar flag to enable explicit-forall syntax: forall <tvs>. <type> }}} It turns out that I had somehow inserted a unicode no break space, character code `U+00a0`, in the line importing RankNTypes, just after the first `#`. Baffling. This begs the question: should GHC treat this unicode space as an ordinary space when the `UnicodeSyntax` extension is enabled? If not should there have been some warning that I had inserted this symbol in a language pragma? -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7671> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7671: No break spaces ----------------------------------+----------------------------------------- Reporter: zenzike | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler (Parser) | Version: 7.6.2 Keywords: alex lexer | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: T7671 Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Changes (by igloo): * keywords: => alex lexer * difficulty: => Unknown * component: Compiler => Compiler (Parser) * testcase: => T7671 * milestone: => 7.8.1 Comment: Thanks for the report. This is meant to work, but it's broken. It looks like what's going wrong is that `known_pragma` is assuming that `len` is a number of bytes, but it's actually a number of characters. It therefore sees `-#\160LAN[...]` when it expects `{-#\160LAN[...]`. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7671#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7671: No break spaces ----------------------------------+----------------------------------------- Reporter: zenzike | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler (Parser) | Version: 7.6.2 Keywords: alex lexer | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: T7671 Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Comment(by ian@…): commit c68aac1f2e59d0844a285b757777b950da91a8be {{{ Author: Ian Lynagh <ian@well-typed.com> Date: Tue Feb 26 01:27:43 2013 +0000 Fix parsing of pragmas containing unicode characters; fixes #7671 compiler/parser/Lexer.x | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7671#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7671: No break spaces --------------------------------+------------------------------------------- Reporter: zenzike | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler (Parser) | Version: 7.6.2 Resolution: fixed | Keywords: alex lexer Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: T7671 | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- Changes (by igloo): * status: new => closed * resolution: => fixed Comment: Fixed -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7671#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC