Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Alex D
GHC
Commits
274a7b1a
Commit
274a7b1a
authored
Mar 29, 2006
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in stage1, we should get isPrint and isUpper from Compat.Unicode, not Data.Char
parent
c117f1be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
ghc/compiler/parser/Lexer.x
ghc/compiler/parser/Lexer.x
+3
-3
ghc/lib/compat/Compat/Unicode.hs
ghc/lib/compat/Compat/Unicode.hs
+10
-1
No files found.
ghc/compiler/parser/Lexer.x
View file @
274a7b1a
...
...
@@ -44,14 +44,14 @@ import Ctype
import Util ( maybePrefixMatch, readRational )
import DATA_BITS
import Data.Char
import Data.Char
( chr )
import Ratio
--import TRACE
#if __GLASGOW_HASKELL__ >= 605
import Data.Char ( GeneralCategory(..), generalCategory )
import Data.Char ( GeneralCategory(..), generalCategory
, isPrint, isUpper
)
#else
import Compat.Unicode ( GeneralCategory(..), generalCategory )
import Compat.Unicode ( GeneralCategory(..), generalCategory
, isPrint, isUpper
)
#endif
}
...
...
ghc/lib/compat/Compat/Unicode.hs
View file @
274a7b1a
{-# OPTIONS -cpp #-}
module
Compat.Unicode
(
GeneralCategory
(
..
),
generalCategory
,
GeneralCategory
(
..
),
generalCategory
,
isPrint
,
isUpper
)
where
#
if
__GLASGOW_HASKELL__
>
604
...
...
@@ -54,4 +54,13 @@ generalCategory c = toEnum (wgencat (fromIntegral (ord c)))
foreign
import
ccall
unsafe
"u_gencat"
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment