Skip to content

Commit 5c4bed5

Browse files
committed
Merge branch 'ghc-9.2' into master
2 parents 1fd927c + 33331a9 commit 5c4bed5

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

CHANGELOG.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
* Support for the GHC 9.2.
44

5-
The array access primops now read/write with the fixed-sized numeric
6-
type corresponding to the width of the data accessed. Additionally,
7-
the primops to convert to and from fixed-sized numeric types have
8-
been given new names.
9-
10-
9.2 isn't cut yet, so these changes are somewhat speculative, but
11-
unfortunately GHC must used a released version of Alex (and Happy) at
12-
all times until further changes have been made, so we must make the
13-
release to actually implement these changes in GHC.
5+
The array access primops now use the fixed-sized numeric types
6+
corresponding to the width of the data accessed. Additionally, the
7+
primops to convert to and from fixed-sized numeric types have been
8+
given new names.
9+
10+
9.2 isn't cut yet, so these changes are somewhat speculative.
11+
Unfortunately, GHC must used a released version of Alex (and Happy)
12+
at all times until further changes have been made, so we must make
13+
the release to actually implement these changes in GHC.
1414

1515
If the final GHC 9.2 ends up being different, this release will be
1616
marked broken to make it less likely people use it by accident.

alex.cabal

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: >= 1.8
1+
cabal-version: >= 1.10
22
name: alex
33
version: 3.2.6
44
-- don't forget updating changelog.md!
@@ -143,8 +143,12 @@ executable alex
143143

144144
build-depends: base < 5
145145

146-
extensions: CPP
146+
default-language: Haskell98
147+
default-extensions: CPP
148+
other-extensions: MagicHash
149+
147150
ghc-options: -Wall -rtsopts
151+
148152
other-modules:
149153
AbsSyn
150154
CharSet
@@ -174,4 +178,6 @@ test-suite tests
174178
-- This line is important as it ensures that the local `exe:alex` component declared above is built before the test-suite component is invoked, as well as making sure that `alex` is made available on $PATH and `$alex_datadir` is set accordingly before invoking `test.hs`
175179
build-tools: alex
176180

181+
default-language: Haskell98
182+
177183
build-depends: base, process

src/AbsSyn.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ extractActions scheme scanner = (scanner{scannerTokens = new_tokens}, decl_str .
336336
where
337337
(new_tokens, decls) = unzip (zipWith f (scannerTokens scanner) act_names)
338338

339-
f r@RECtx{ reCtxCode = Just code } name
339+
f r@(RECtx{ reCtxCode = Just code }) name
340340
= (r{reCtxCode = Just name}, Just (mkDecl name code))
341-
f r@RECtx{ reCtxCode = Nothing } _
341+
f r@(RECtx{ reCtxCode = Nothing }) _
342342
= (r{reCtxCode = Nothing}, Nothing)
343343

344344
gscanActionType res =

src/DFAMin.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ import qualified Data.List as List
3636
-- end;
3737

3838
minimizeDFA :: forall a. Ord a => DFA Int a -> DFA Int a
39-
minimizeDFA dfa@DFA { dfa_start_states = starts,
40-
dfa_states = statemap
41-
}
39+
minimizeDFA dfa@(DFA { dfa_start_states = starts,
40+
dfa_states = statemap
41+
})
4242
= DFA { dfa_start_states = starts,
4343
dfa_states = Map.fromList states }
4444
where

templates/GenericTemplate.hs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define ALEX_IF_GHC_GT_500 #if __GLASGOW_HASKELL__ > 500
1313
#define ALEX_IF_GHC_LT_503 #if __GLASGOW_HASKELL__ < 503
1414
#define ALEX_IF_GHC_GT_706 #if __GLASGOW_HASKELL__ > 706
15-
#define ALEX_IF_GHC_GT_901 #if __GLASGOW_HASKELL__ > 901
15+
#define ALEX_IF_GHC_GE_901 #if __GLASGOW_HASKELL__ >= 901
1616
#define ALEX_ELIF_GHC_500 #elif __GLASGOW_HASKELL__ == 500
1717
#define ALEX_IF_BIGENDIAN #ifdef WORDS_BIGENDIAN
1818
#define ALEX_ELSE #else
@@ -61,18 +61,17 @@ ALEX_ENDIF
6161
alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
6262
alexIndexInt16OffAddr (AlexA# arr) off =
6363
ALEX_IF_BIGENDIAN
64-
ALEX_IF_GHC_GT_901
6564
narrow16Int# i
66-
ALEX_ELSE
67-
int16ToInt# i
68-
ALEX_ENDIF
6965
where
7066
i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
7167
high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
7268
low = int2Word# (ord# (indexCharOffAddr# arr off'))
7369
off' = off *# 2#
7470
ALEX_ELSE
75-
indexInt16OffAddr# arr off
71+
ALEX_IF_GHC_GE_901
72+
int16ToInt#
73+
ALEX_ENDIF
74+
(indexInt16OffAddr# arr off)
7675
ALEX_ENDIF
7776
#else
7877
alexIndexInt16OffAddr arr off = arr ! off
@@ -83,11 +82,7 @@ alexIndexInt16OffAddr arr off = arr ! off
8382
alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
8483
alexIndexInt32OffAddr (AlexA# arr) off =
8584
ALEX_IF_BIGENDIAN
86-
ALEX_IF_GHC_GT_901
8785
narrow32Int# i
88-
ALEX_ELSE
89-
int32ToInt# i
90-
ALEX_ENDIF
9186
where
9287
i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`
9388
(b2 `uncheckedShiftL#` 16#) `or#`
@@ -98,7 +93,10 @@ ALEX_ENDIF
9893
b0 = int2Word# (ord# (indexCharOffAddr# arr off'))
9994
off' = off *# 4#
10095
ALEX_ELSE
101-
indexInt32OffAddr# arr off
96+
ALEX_IF_GHC_GE_901
97+
int32ToInt#
98+
ALEX_ENDIF
99+
(indexInt32OffAddr# arr off)
102100
ALEX_ENDIF
103101
#else
104102
alexIndexInt32OffAddr arr off = arr ! off

0 commit comments

Comments
 (0)