From 34e845107f30d00a3dc348df43eef3df0d20cd5f Mon Sep 17 00:00:00 2001 From: Sebastian Graf Date: Mon, 23 Sep 2024 09:29:47 +0200 Subject: [PATCH] Add -XPatternGuards and build tests with -XHaskell98 (#309) Fixes #309. --- lib/backend-lalr/src/Happy/Backend/LALR.hs | 2 +- tests/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/backend-lalr/src/Happy/Backend/LALR.hs b/lib/backend-lalr/src/Happy/Backend/LALR.hs index ca144464..78bf47d7 100644 --- a/lib/backend-lalr/src/Happy/Backend/LALR.hs +++ b/lib/backend-lalr/src/Happy/Backend/LALR.hs @@ -35,7 +35,7 @@ importsToInject debug = concat ["\n", import_array, import_bits, import_glaexts, "import Control.Monad (ap)\n" langExtsToInject :: [String] -langExtsToInject = ["MagicHash", "BangPatterns", "TypeSynonymInstances", "FlexibleInstances", "NoStrictData"] +langExtsToInject = ["MagicHash", "BangPatterns", "TypeSynonymInstances", "FlexibleInstances", "PatternGuards", "NoStrictData"] defines :: Bool -> Bool -> String defines debug coerce = unlines [ "#define " ++ d ++ " 1" | d <- vars_to_define ] diff --git a/tests/Makefile b/tests/Makefile index 17765d7d..3fd483de 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -5,7 +5,7 @@ # [2021-07-14, PR #196](https://github.com/haskell/happy/pull/196) # HC ?= ghc -HC_OPTS=-package array -Wall -Werror +HC_OPTS=-package array -Wall -Werror -XHaskell98 # NOTE: `cabal test` will take care to build the local `happy` # executable and place it into $PATH for us to pick up.