#3050: parsec: bug in caret escape parsing
-----------------------------+----------------------------------------------
Reporter:  sof               |          Owner:                   
    Type:  bug               |         Status:  new              
Priority:  normal            |      Component:  libraries (other)
 Version:  6.10.1            |       Severity:  normal           
Keywords:                    |       Testcase:                   
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple 
-----------------------------+----------------------------------------------
 The parsing of escape carets in character literals isn't quite right:
  * off-by-one (i.e., \^A == \NUL; ought to be \^A=\001)
  * only A-Z carets are supported.

 The following minor mod takes care of the problem:

 {{{
 --- Text/ParserCombinators/Parsec/Token.hs      2009-02-20
 10:49:32.115500000 -0800
 +++ Text/ParserCombinators/Parsec/Token.hs.~1~  2009-02-20
 10:02:45.896750000 -0800
 @@ -193,8 +193,8 @@

      -- charControl :: CharParser st Char
      charControl     = do{ char '^'
 -                        ; code <- (oneOf ['@'..'_']) <|> char '?'
 -                        ; return (if code == '?' then '\DEL' else toEnum
 (fromEnum code - fromEnum '@'))
 +                        ; code <- upper
 +                        ; return (toEnum (fromEnum code - fromEnum 'A'))
                          }
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3050>
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

Reply via email to