[GHC] #9947: Unicode «other number» characters not consistently accepted in identifiers

#9947: Unicode «other number» characters not consistently accepted in identifiers -------------------------------------+------------------------------------- Reporter: zardoz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- I’ve noticed that some characters classified as numeric by the Unicode standard will currently generate a lexical error. E.g., characters from the «enclosed alphanumerics» block don’t work, such as ① (circled digit one, U+2460), despite having being of the general Unicode category «other number». Usually, «other number» characters are accepted in identifiers. E.g., superscripts like «²» work fine. This is related to https://ghc.haskell.org/trac/ghc/ticket/5108 , where modifier letters (which are also alphanumeric in Unicode) also throw a lexical error. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9947 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9947: Unicode «other number» characters not consistently accepted in identifiers -------------------------------------+------------------------------------- Reporter: zardoz | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #4373 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => infoneeded * related: => #4373 Comment: I can not reproduce your problem. U+2460 and U+00B2 are treated in the same way: allowed in variable identifiers, not allowed in operator identifiers. Just like numbers. This compiles: {{{#!hs -- Superscript two (U+00B2) -- Block: Latin-1 Supplement -- General Category: OtherNumber (No) -- Haskell: number xB2 = '²' xB2_² = 4 -- Error (numbers not allowed in operators): -- data a +² b = XB2 a b -- Circle digit 1 (U+2460) -- Block: Enclosed Alphanumerics -- General Category: OtherNumber (No) -- Haskell: number x2460 = '①' x2460_① = 1 -- Error (numbers not allowed in operators): --data a +① b = X2460 a b }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9947#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9947: Unicode «other number» characters not consistently accepted in identifiers -------------------------------------+------------------------------------- Reporter: zardoz | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #4373 | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): That is with GHC 7.8.4. Please supply a small code snippet that you expect to work, but doesn't. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9947#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9947: Unicode «other number» characters not consistently accepted in identifiers -------------------------------------+------------------------------------- Reporter: zardoz | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | Keywords: Resolution: worksforme | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #4373 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => closed * resolution: => worksforme Comment: zardoz: please reopen if you do think there is a bug in GHC. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9947#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC