Changeset 12268 for src/Pugs/Lexer.hs

Show
Ignore:
Timestamp:
08/15/06 19:18:47 (2 years ago)
Author:
audreyt
Message:

* Pugs.Lexer: "\08..." and "\09..." are treated as "\0" and then "8..." or "9...".

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Lexer.hs

    r12266 r12268  
    280280        [ many1 digit >>= \ds -> case ds of 
    281281            "0" -> return [0] 
     282            -- "\08..." and "\09..." are treated as "\0" and then "8..." or "9...". 
     283            ('0':xs@(x:_)) | x == '8' || x == '9' -> return (0:map (toInteger . ord) xs) 
    282284            _   -> error ("Error: Invalid escape sequence \\" ++ ds ++ "; write as decimal \\d" ++ ds ++ " or octal \\o" ++ ds ++ " instead") -- $ return [read ds] 
    283285        , based 'o'  8 octDigit