Commit 274a7b1a authored by Simon Marlow's avatar Simon Marlow

in stage1, we should get isPrint and isUpper from Compat.Unicode, not Data.Char

parent c117f1be
...@@ -44,14 +44,14 @@ import Ctype ...@@ -44,14 +44,14 @@ import Ctype
import Util ( maybePrefixMatch, readRational ) import Util ( maybePrefixMatch, readRational )
import DATA_BITS import DATA_BITS
import Data.Char import Data.Char ( chr )
import Ratio import Ratio
--import TRACE --import TRACE
#if __GLASGOW_HASKELL__ >= 605 #if __GLASGOW_HASKELL__ >= 605
import Data.Char ( GeneralCategory(..), generalCategory ) import Data.Char ( GeneralCategory(..), generalCategory, isPrint, isUpper )
#else #else
import Compat.Unicode ( GeneralCategory(..), generalCategory ) import Compat.Unicode ( GeneralCategory(..), generalCategory, isPrint, isUpper )
#endif #endif
} }
......
{-# OPTIONS -cpp #-} {-# OPTIONS -cpp #-}
module Compat.Unicode ( module Compat.Unicode (
GeneralCategory(..), generalCategory, GeneralCategory(..), generalCategory, isPrint, isUpper
) where ) where
#if __GLASGOW_HASKELL__ > 604 #if __GLASGOW_HASKELL__ > 604
...@@ -54,4 +54,13 @@ generalCategory c = toEnum (wgencat (fromIntegral (ord c))) ...@@ -54,4 +54,13 @@ generalCategory c = toEnum (wgencat (fromIntegral (ord c)))
foreign import ccall unsafe "u_gencat" foreign import ccall unsafe "u_gencat"
wgencat :: CInt -> Int wgencat :: CInt -> Int
isPrint c = iswprint (fromIntegral (ord c)) /= 0
isUpper c = iswupper (fromIntegral (ord c)) /= 0
foreign import ccall unsafe "u_iswprint"
iswprint :: CInt -> CInt
foreign import ccall unsafe "u_iswupper"
iswupper :: CInt -> CInt
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment