summaryrefslogtreecommitdiff
path: root/compiler/utils/Encoding.hs
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-07-21 14:59:55 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-08-24 19:07:00 +0200
commit37a0b50b5e28a326159bb464effb499c1d9de775 (patch)
treed329bc0a2d54c1342e433fe6aa40ccb3419aa814 /compiler/utils/Encoding.hs
parenta5061a96724922097e4181d452a64618e35fa297 (diff)
downloadhaskell-37a0b50b5e28a326159bb464effb499c1d9de775.tar.gz
Delete ExtsCompat46 (#8330)
We require ghc-7.8 to build HEAD (ghc-7.11). Differential Revision: https://phabricator.haskell.org/D1165
Diffstat (limited to 'compiler/utils/Encoding.hs')
-rw-r--r--compiler/utils/Encoding.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/utils/Encoding.hs b/compiler/utils/Encoding.hs
index ae727d2f3f..c8dcea24a7 100644
--- a/compiler/utils/Encoding.hs
+++ b/compiler/utils/Encoding.hs
@@ -31,7 +31,7 @@ module Encoding (
import Foreign
import Data.Char
import Numeric
-import ExtsCompat46
+import GHC.Exts
-- -----------------------------------------------------------------------------
-- UTF-8
@@ -50,32 +50,32 @@ utf8DecodeChar# :: Addr# -> (# Char#, Int# #)
utf8DecodeChar# a# =
let !ch0 = word2Int# (indexWord8OffAddr# a# 0#) in
case () of
- _ | ch0 <=# 0x7F# -> (# chr# ch0, 1# #)
+ _ | isTrue# (ch0 <=# 0x7F#) -> (# chr# ch0, 1# #)
- | ch0 >=# 0xC0# && ch0 <=# 0xDF# ->
+ | isTrue# ((ch0 >=# 0xC0#) `andI#` (ch0 <=# 0xDF#)) ->
let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in
- if ch1 <# 0x80# || ch1 >=# 0xC0# then fail 1# else
+ if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else
(# chr# (((ch0 -# 0xC0#) `uncheckedIShiftL#` 6#) +#
(ch1 -# 0x80#)),
2# #)
- | ch0 >=# 0xE0# && ch0 <=# 0xEF# ->
+ | isTrue# ((ch0 >=# 0xE0#) `andI#` (ch0 <=# 0xEF#)) ->
let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in
- if ch1 <# 0x80# || ch1 >=# 0xC0# then fail 1# else
+ if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else
let !ch2 = word2Int# (indexWord8OffAddr# a# 2#) in
- if ch2 <# 0x80# || ch2 >=# 0xC0# then fail 2# else
+ if isTrue# ((ch2 <# 0x80#) `orI#` (ch2 >=# 0xC0#)) then fail 2# else
(# chr# (((ch0 -# 0xE0#) `uncheckedIShiftL#` 12#) +#
((ch1 -# 0x80#) `uncheckedIShiftL#` 6#) +#
(ch2 -# 0x80#)),
3# #)
- | ch0 >=# 0xF0# && ch0 <=# 0xF8# ->
+ | isTrue# ((ch0 >=# 0xF0#) `andI#` (ch0 <=# 0xF8#)) ->
let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in
- if ch1 <# 0x80# || ch1 >=# 0xC0# then fail 1# else
+ if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else
let !ch2 = word2Int# (indexWord8OffAddr# a# 2#) in
- if ch2 <# 0x80# || ch2 >=# 0xC0# then fail 2# else
+ if isTrue# ((ch2 <# 0x80#) `orI#` (ch2 >=# 0xC0#)) then fail 2# else
let !ch3 = word2Int# (indexWord8OffAddr# a# 3#) in
- if ch3 <# 0x80# || ch3 >=# 0xC0# then fail 3# else
+ if isTrue# ((ch3 <# 0x80#) `orI#` (ch3 >=# 0xC0#)) then fail 3# else
(# chr# (((ch0 -# 0xF0#) `uncheckedIShiftL#` 18#) +#
((ch1 -# 0x80#) `uncheckedIShiftL#` 12#) +#
((ch2 -# 0x80#) `uncheckedIShiftL#` 6#) +#