mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
implement --gfo-dir. before it was recognized but ignored
This commit is contained in:
@@ -160,7 +160,9 @@ compileOne opts env@(_,srcgr,_) file = do
|
|||||||
-- for gf source, do full compilation and generate code
|
-- for gf source, do full compilation and generate code
|
||||||
_ -> do
|
_ -> do
|
||||||
|
|
||||||
let gfo = gfoFile (dropExtension file)
|
let gfo = maybe (gfoFile (dropExtension file))
|
||||||
|
(\dir -> dir </> gfoFile (dropExtension (takeFileName file)))
|
||||||
|
(flag optGFODir opts)
|
||||||
b1 <- ioeIO $ doesFileExist file
|
b1 <- ioeIO $ doesFileExist file
|
||||||
if not b1
|
if not b1
|
||||||
then compileOne opts env $ gfo
|
then compileOne opts env $ gfo
|
||||||
|
|||||||
@@ -146,11 +146,11 @@ data Flags = Flags {
|
|||||||
optVerbosity :: Verbosity,
|
optVerbosity :: Verbosity,
|
||||||
optShowCPUTime :: Bool,
|
optShowCPUTime :: Bool,
|
||||||
optEmitGFO :: Bool,
|
optEmitGFO :: Bool,
|
||||||
optGFODir :: FilePath,
|
|
||||||
optOutputFormats :: [OutputFormat],
|
optOutputFormats :: [OutputFormat],
|
||||||
optSISR :: Maybe SISRFormat,
|
optSISR :: Maybe SISRFormat,
|
||||||
optHaskellOptions :: Set HaskellOption,
|
optHaskellOptions :: Set HaskellOption,
|
||||||
optLexicalCats :: Set String,
|
optLexicalCats :: Set String,
|
||||||
|
optGFODir :: Maybe FilePath,
|
||||||
optOutputFile :: Maybe FilePath,
|
optOutputFile :: Maybe FilePath,
|
||||||
optOutputDir :: Maybe FilePath,
|
optOutputDir :: Maybe FilePath,
|
||||||
optGFLibPath :: Maybe FilePath,
|
optGFLibPath :: Maybe FilePath,
|
||||||
@@ -239,11 +239,11 @@ defaultFlags = Flags {
|
|||||||
optVerbosity = Normal,
|
optVerbosity = Normal,
|
||||||
optShowCPUTime = False,
|
optShowCPUTime = False,
|
||||||
optEmitGFO = True,
|
optEmitGFO = True,
|
||||||
optGFODir = ".",
|
|
||||||
optOutputFormats = [],
|
optOutputFormats = [],
|
||||||
optSISR = Nothing,
|
optSISR = Nothing,
|
||||||
optHaskellOptions = Set.empty,
|
optHaskellOptions = Set.empty,
|
||||||
optLexicalCats = Set.empty,
|
optLexicalCats = Set.empty,
|
||||||
|
optGFODir = Nothing,
|
||||||
optOutputFile = Nothing,
|
optOutputFile = Nothing,
|
||||||
optOutputDir = Nothing,
|
optOutputDir = Nothing,
|
||||||
optGFLibPath = Nothing,
|
optGFLibPath = Nothing,
|
||||||
@@ -373,7 +373,7 @@ optDescr =
|
|||||||
Nothing -> fail $ "Bad verbosity: " ++ show v
|
Nothing -> fail $ "Bad verbosity: " ++ show v
|
||||||
cpu x = set $ \o -> o { optShowCPUTime = x }
|
cpu x = set $ \o -> o { optShowCPUTime = x }
|
||||||
emitGFO x = set $ \o -> o { optEmitGFO = x }
|
emitGFO x = set $ \o -> o { optEmitGFO = x }
|
||||||
gfoDir x = set $ \o -> o { optGFODir = x }
|
gfoDir x = set $ \o -> o { optGFODir = Just x }
|
||||||
outFmt x = readOutputFormat x >>= \f ->
|
outFmt x = readOutputFormat x >>= \f ->
|
||||||
set $ \o -> o { optOutputFormats = optOutputFormats o ++ [f] }
|
set $ \o -> o { optOutputFormats = optOutputFormats o ++ [f] }
|
||||||
sisrFmt x = case x of
|
sisrFmt x = case x of
|
||||||
|
|||||||
Reference in New Issue
Block a user