diff --git a/source/src/BNFC/Backend/Haskell.hs b/source/src/BNFC/Backend/Haskell.hs index 6863ad93..15adf1cc 100644 --- a/source/src/BNFC/Backend/Haskell.hs +++ b/source/src/BNFC/Backend/Haskell.hs @@ -255,7 +255,8 @@ makefile opts makeFile = vcat -- | Rule to build Haskell test parser. testParserRule :: Doc - testParserRule = Makefile.mkRule tgt deps [ "ghc --make $< -o $@" ] + testParserRule = Makefile.mkRule tgt deps + [ unwords [ "ghc --make $<", "-main-is", tFileM opts, "-o $@" ] ] where tgt :: String tgt = tFileExe opts @@ -288,7 +289,7 @@ testfile :: Options -> CF -> String testfile opts cf = unlines $ concat $ [ [ "-- Program to test parser, automatically generated by BNF Converter." , "" - , "module Main where" + , unwords [ "module", tFileM opts, "where" ] , "" ] , case tokenText opts of diff --git a/source/src/BNFC/Backend/Haskell/HsOpts.hs b/source/src/BNFC/Backend/Haskell/HsOpts.hs index b5d69264..27436af3 100644 --- a/source/src/BNFC/Backend/Haskell/HsOpts.hs +++ b/source/src/BNFC/Backend/Haskell/HsOpts.hs @@ -16,7 +16,8 @@ absFile, absFileM, templateFile, templateFileM, printerFile, printerFileM, layoutFile, layoutFileM, - tFile, tFileExe :: Options -> String + tFile, tFileM, tFileExe + :: Options -> String absFile = mkFile withLang "Abs" "hs" absFileM = mkMod withLang "Abs" alexFile = mkFile withLang "Lex" "x" @@ -31,6 +32,7 @@ templateFileM = mkMod withLang "Skel" printerFile = mkFile withLang "Print" "hs" printerFileM = mkMod withLang "Print" tFile = mkFile withLang "Test" "hs" +tFileM = mkMod withLang "Test" tFileExe = mkFile withLang "Test" "" errFile = mkFile noLang "ErrM" "hs" errFileM = mkMod noLang "ErrM"