X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2FLex.lhs;h=c15f46fa06b46c4450ae156c9b9b7f96c51bcd64;hb=0588967a4bc5f2e1b5e3bf433334fad59aa07221;hp=f626f4f3ff62b88e76ce0156056ecc061d9028ec;hpb=e164329d3f453f4959a5a0a900b6f8a10003a3a1;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs index f626f4f..c15f46f 100644 --- a/ghc/compiler/parser/Lex.lhs +++ b/ghc/compiler/parser/Lex.lhs @@ -16,7 +16,6 @@ An example that provokes the error is -------------------------------------------------------- \begin{code} -{-# OPTIONS -#include "ctypes.h" #-} module Lex ( @@ -55,12 +54,7 @@ import FastString import StringBuffer import GlaExts import ST ( runST ) - -#if __GLASGOW_HASKELL__ >= 303 -import Bits -import Word -#endif - +import Ctypes import Char ( chr ) import Addr import PrelRead ( readRational__ ) -- Glasgow non-std @@ -869,33 +863,6 @@ lex_cstring cont buf = (mergeLexemes buf buf') Nothing -> lexError "unterminated ``" buf ------------------------------------------------------------------------------- --- Character Classes - -is_ident, is_symbol, is_any, is_upper, is_digit :: Char# -> Bool - -{-# INLINE is_ctype #-} -#if __GLASGOW_HASKELL__ >= 303 -is_ctype :: Word8 -> Char# -> Bool -is_ctype mask = \c -> - (indexWord8OffAddr (``char_types'' :: Addr) (ord (C# c)) .&. mask) /= 0 -#else -is_ctype :: Int -> Char# -> Bool -is_ctype (I# mask) = \c -> - let (A# ctype) = ``char_types'' :: Addr - flag_word = int2Word# (ord# (indexCharOffAddr# ctype (ord# c))) - in - (flag_word `and#` (int2Word# mask)) `neWord#` (int2Word# 0#) -#endif - -is_ident = is_ctype 1 -is_symbol = is_ctype 2 -is_any = is_ctype 4 -is_space = is_ctype 8 -is_lower = is_ctype 16 -is_upper = is_ctype 32 -is_digit = is_ctype 64 - ----------------------------------------------------------------------------- -- identifiers, symbols etc.