Skip to content

Commit

Permalink
Emit a warning when -g was not passed (#268)
Browse files Browse the repository at this point in the history
Fixes #268.
  • Loading branch information
sgraf812 committed Sep 13, 2024
1 parent 10a0fe5 commit 2a5da28
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Main.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Path settings auto-generated by Cabal:
> import Happy.Tabular.Info (genInfoFile)

> import System.Console.GetOpt
> import Control.Monad ( liftM, when )
> import Control.Monad ( liftM, when, unless )
> import System.Environment
> import System.Exit (exitWith, ExitCode(..))
> import Data.Char
Expand Down Expand Up @@ -62,6 +62,11 @@ Read and parse the CLI arguments.
> where
> runParserGen cli fl_name = do

If no -g flag has been passed, show a warning.

> unless (OptGhcTarget `elem` cli) $
> hPutStrLn stderr "Warning: With happy 2.0, the --ghc flag has become non-optional. To suppress this warning, pass the --ghc flag."

Open the file.

> fl <- readFile fl_name
Expand Down

0 comments on commit 2a5da28

Please sign in to comment.