#2304: unicode digits misparsed in escape sequences
------------------------+---------------------------------------------------
    Reporter:  guest    |       Owner:                   
        Type:  bug      |      Status:  new              
    Priority:  normal   |   Component:  Compiler (Parser)
     Version:  6.8.2    |    Severity:  normal           
    Keywords:           |    Testcase:                   
Architecture:  Unknown  |          Os:  Linux            
------------------------+---------------------------------------------------
 {{{
 *> "\₁"
 *** Exception: parser/Ctype.lhs:(91,13)-(347,35): Non-exhaustive patterns
 in case

 *> "\๔"
 *** Exception: parser/Ctype.lhs:(91,13)-(347,35): Non-exhaustive patterns
 in case
 }}}

 I haven't seen ghc's code, but I bet it uses something like `let (digits,
 str') = span isDigit str in chr (read digits) : parse str'` to process
 escape sequences in string/character literals. This is broken because
 `isDigit` returns `True` for a lot of non-`['0'..'9']` characters, such as
 subscripts, Thai digits, double-wide digits, etc.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2304>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to