Skip to content
Snippets Groups Projects
Commit 0368ee9a authored by Brandon Chinn's avatar Brandon Chinn Committed by Cheng Shao
Browse files

Fix for alex-3.5.2.0 (#25623)

This INLINE pragma for alexScanUser was added in 9.12, but then I
ported the change to alex in 3.5.2.0
(https://github.com/haskell/alex/pull/262).

I didn't realize that GHC errors on duplicate INLINE pragmas, so
this ended up being a breaking change.

This change should be backported into 9.12

(cherry picked from commit a1d92378)
parent ed00bea7
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@
-- Alex "Haskell code fragment top"
{
{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
......@@ -3471,10 +3472,14 @@ topNoLayoutContainsCommas [] = False
topNoLayoutContainsCommas (ALRLayout _ _ : ls) = topNoLayoutContainsCommas ls
topNoLayoutContainsCommas (ALRNoLayout b _ : _) = b
#ifdef MIN_TOOL_VERSION_alex
#if !MIN_TOOL_VERSION_alex(3,5,2)
-- If the generated alexScan/alexScanUser functions are called multiple times
-- in this file, alexScanUser gets broken out into a separate function and
-- increases memory usage. Make sure GHC inlines this function and optimizes it.
{-# INLINE alexScanUser #-}
#endif
#endif
lexToken :: P (PsLocated Token)
lexToken = do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment