@@ -58,9 +58,14 @@ uncheckedShiftL# = shiftL#
58
58
ALEX_ENDIF
59
59
60
60
{-# INLINE alexIndexInt16OffAddr #-}
61
+ alexIndexInt16OffAddr :: AlexAddr -> Int # -> Int #
61
62
alexIndexInt16OffAddr (AlexA # arr) off =
62
63
ALEX_IF_BIGENDIAN
64
+ ALEX_IF_GHC_GT_901
63
65
narrow16Int# i
66
+ ALEX_ELSE
67
+ int16ToInt# i
68
+ ALEX_ENDIF
64
69
where
65
70
i = word2Int# ((high `uncheckedShiftL# ` 8 # ) `or # ` low)
66
71
high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1 # )))
@@ -75,9 +80,14 @@ alexIndexInt16OffAddr arr off = arr ! off
75
80
76
81
#ifdef ALEX_GHC
77
82
{-# INLINE alexIndexInt32OffAddr #-}
83
+ alexIndexInt32OffAddr :: AlexAddr -> Int # -> Int #
78
84
alexIndexInt32OffAddr (AlexA # arr) off =
79
85
ALEX_IF_BIGENDIAN
86
+ ALEX_IF_GHC_GT_901
80
87
narrow32Int# i
88
+ ALEX_ELSE
89
+ int32ToInt# i
90
+ ALEX_ENDIF
81
91
where
82
92
i = word2Int# ((b3 `uncheckedShiftL# ` 24 # ) `or # `
83
93
(b2 `uncheckedShiftL# ` 16 # ) `or # `
@@ -164,23 +174,13 @@ alex_scan_tkn user__ orig_input len input__ s last_acc =
164
174
#endif
165
175
case fromIntegral c of { IBOX (ord_c) ->
166
176
let
167
- ALEX_IF_GHC_GT_901
168
- base = int32ToInt# (alexIndexInt32OffAddr alex_base s)
169
- offset = PLUS (base,ord_c)
170
- check = int16ToInt# (alexIndexInt16OffAddr alex_check offset)
171
-
172
- new_s = if GTE (offset,ILIT (0 )) && EQ (check,ord_c)
173
- then int16ToInt# (alexIndexInt16OffAddr alex_table offset)
174
- else int16ToInt# (alexIndexInt16OffAddr alex_deflt s)
175
- ALEX_ELSE
176
177
base = alexIndexInt32OffAddr alex_base s
177
178
offset = PLUS (base,ord_c)
178
179
check = alexIndexInt16OffAddr alex_check offset
179
180
180
181
new_s = if GTE (offset,ILIT (0 )) && EQ (check,ord_c)
181
182
then alexIndexInt16OffAddr alex_table offset
182
183
else alexIndexInt16OffAddr alex_deflt s
183
- ALEX_ENDIF
184
184
in
185
185
case new_s of
186
186
ILIT (- 1 ) -> (new_acc, input__)
0 commit comments