File tree Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Original file line number Diff line number Diff line change 40
40
#ifdef ALEX_GHC
41
41
data AlexAddr = AlexA # Addr #
42
42
-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
43
- #if __GLASGOW_HASKELL__ < 503
44
- uncheckedShiftL# = shiftL#
45
- #endif
46
43
47
44
{-# INLINE alexIndexInt16OffAddr #-}
48
45
alexIndexInt16OffAddr :: AlexAddr -> Int # -> Int #
@@ -90,13 +87,8 @@ alexIndexInt32OffAddr arr off = arr ! off
90
87
#endif
91
88
92
89
#ifdef ALEX_GHC
93
-
94
- #if __GLASGOW_HASKELL__ < 503
95
- quickIndex arr i = arr ! i
96
- #else
97
90
-- GHC >= 503, unsafeAt is available from Data.Array.Base.
98
91
quickIndex = unsafeAt
99
- #endif
100
92
#else
101
93
quickIndex arr i = arr ! i
102
94
#endif
Original file line number Diff line number Diff line change @@ -393,40 +393,25 @@ importsToInject _ cli = always_imports ++ debug_imports ++ glaexts_import
393
393
debug_imports | OptDebugParser `elem` cli = import_debug
394
394
| otherwise = " "
395
395
396
- -- CPP is turned on for -fglasogw-exts, so we can use conditional
397
- -- compilation. We need to #include "config.h" to get hold of
396
+ -- We need to #include "ghcconfig.h" to get hold of
398
397
-- WORDS_BIGENDIAN (see AlexTemplate.hs).
399
398
400
399
always_imports :: String
401
- always_imports = " #if __GLASGOW_HASKELL__ >= 603\n " ++
402
- " #include \" ghcconfig.h\"\n " ++
403
- " #elif defined(__GLASGOW_HASKELL__)\n " ++
404
- " #include \" config.h\"\n " ++
405
- " #endif\n " ++
406
- " #if __GLASGOW_HASKELL__ >= 503\n " ++
400
+ always_imports = " #include \" ghcconfig.h\"\n " ++
407
401
" import Data.Array\n " ++
408
- " #else\n " ++
409
- " import Array\n " ++
410
- " #endif\n "
402
+ " "
411
403
412
404
import_glaexts :: String
413
- import_glaexts = " #if __GLASGOW_HASKELL__ >= 503\n " ++
414
- " import Data.Array.Base (unsafeAt)\n " ++
405
+ import_glaexts = " import Data.Array.Base (unsafeAt)\n " ++
415
406
" import GHC.Exts\n " ++
416
- " #else\n " ++
417
- " import GlaExts\n " ++
418
- " #endif\n "
407
+ " "
419
408
420
409
import_debug :: String
421
- import_debug = " #if __GLASGOW_HASKELL__ >= 503\n " ++
422
- " import Data.Char (chr)\n " ++
410
+ import_debug = " import Data.Char (chr)\n " ++
423
411
" import System.IO\n " ++
424
412
" import System.IO.Unsafe\n " ++
425
413
" import Debug.Trace\n " ++
426
- " #else\n " ++
427
- " import IO\n " ++
428
- " import IOExts\n " ++
429
- " #endif\n "
414
+ " "
430
415
431
416
templateDir :: IO FilePath -> [CLIFlags ] -> IO FilePath
432
417
templateDir def cli
You can’t perform that action at this time.
0 commit comments