Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- "9.4.8"
- "9.6.7"
- "9.8.4"
- "9.10.1"
- "9.10.2"
- "9.12.2"
include:
- ghc: "9.12.2"
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
*.dyn_o
*.info
/.ghc.environment.*
/data/
/dist
/dist-newstyle
/examples/*.alex.hs
/examples/*.happy.hs
/examples/*.bin
/examples/*.exe
/old-*/
/tests/*.[dgn].hs
/tests/*.[dgn].bin
/tests/*.[dgn].exe
/tests/*.[dign].hs
/tests/*.[dign].bin
/tests/*.[dign].exe
.cabal-sandbox
.stack-work
cabal.sandbox.config
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Changes in 3.5.4.0

* Fix [issue #277](https://github.com/haskell/alex/issues/277):
compatibility of generated code with `{-# LANGUAGE ImpredicativeTypes #-}`,
thanks Nadia Yvette Chambers!
* Simplify `cabal install` ([PR #272](https://github.com/haskell/alex/pull/272)),
thanks Antoine Leblanc!
* Document `examples/words.x`, thanks Piotr Justyna!
* Tested with GHC 8.0 - 9.12.2.

_Andreas Abel, 2025-08-03_

## Changes in 3.5.3.0

* Fix critical bug in automaton minimizer
Expand Down
10 changes: 6 additions & 4 deletions alex.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: >= 1.10
cabal-version: 1.18
name: alex
version: 3.5.3.0
version: 3.5.4.0
-- don't forget updating changelog.md!
license: BSD3
license-file: LICENSE
Expand All @@ -23,7 +23,7 @@ build-type: Simple

tested-with:
GHC == 9.12.2
GHC == 9.10.1
GHC == 9.10.2
GHC == 9.8.4
GHC == 9.6.7
GHC == 9.4.8
Expand All @@ -42,9 +42,11 @@ data-files:
AlexTemplate.hs
AlexWrappers.hs

extra-source-files:
extra-doc-files:
CHANGELOG.md
README.md

extra-source-files:
examples/Makefile
examples/Tokens.x
examples/Tokens_gscan.x
Expand Down
2 changes: 1 addition & 1 deletion data/AlexTemplate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ alex_scan_tkn user__ orig_input len input__ s last_acc =
Nothing -> (new_acc, input__)
Just (c, new_input) ->
#ifdef ALEX_DEBUG
Debug.Trace.trace ("State: " ++ show IBOX(s) ++ ", char: " ++ show c ++ " " ++ (show . chr . fromIntegral) c) $
Debug.Trace.trace ("State: " ++ show IBOX(s) ++ ", char: " ++ show c ++ " " ++ (show . Data.Char.chr . fromIntegral) c) $
#endif
case fromIntegral c of { IBOX(ord_c) ->
let
Expand Down
5 changes: 1 addition & 4 deletions data/AlexWrappers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,25 @@ import Data.Word (Word8)
#if defined(ALEX_BASIC_BYTESTRING) || defined(ALEX_POSN_BYTESTRING) || defined(ALEX_MONAD_BYTESTRING)

import Data.Int (Int64)
import qualified Data.Char
import qualified Data.ByteString.Lazy as ByteString
import qualified Data.ByteString.Internal as ByteString (w2c)

#elif defined(ALEX_STRICT_BYTESTRING)

import qualified Data.Char
import qualified Data.ByteString as ByteString
import qualified Data.ByteString.Internal as ByteString hiding (ByteString)
import qualified Data.ByteString.Unsafe as ByteString

#else

import Data.Char (ord)
import qualified Data.Bits

-- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
utf8Encode :: Char -> [Word8]
utf8Encode = uncurry (:) . utf8Encode'

utf8Encode' :: Char -> (Word8, [Word8])
utf8Encode' c = case go (ord c) of
utf8Encode' c = case go (Data.Char.ord c) of
(x, xs) -> (fromIntegral x, map fromIntegral xs)
where
go oc
Expand Down
4 changes: 2 additions & 2 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ always_imports :: [String]
always_imports =
[ "#include \"ghcconfig.h\""
, "import qualified Data.Array"
, "import qualified Data.Char"
]

import_glaexts :: [String]
Expand Down Expand Up @@ -437,8 +438,7 @@ import_glaexts =

import_debug :: [String]
import_debug =
[ "import Data.Char (chr)"
, "import qualified Debug.Trace"
[ "import qualified Debug.Trace"
]

templateDir :: IO FilePath -> [CLIFlags] -> IO FilePath
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WARNS_DEP_GHC_GTEQ_9_8:=$(shell if [ $(GHC_MAJOR_VERSION) -gt 9 -o $(GHC_MAJOR_V

HC_OPTS=-Wall $(WARNS_DEP_GHC_GTEQ_9_8) -fwarn-incomplete-uni-patterns -Werror

.PRECIOUS: %.n.hs %.g.hs %.o %.exe %.bin
.PRECIOUS: %.d.hs %.i.hs %.g.hs %.n.hs %.o %.exe %.bin

ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
HS_PROG_EXT = .exe
Expand Down
Loading