forked from GitHub/gf-core
Use NOINLINE for build info and darcs version info
... to avoid unnecessary recompilation of other modules.
This commit is contained in:
1
Setup.hs
1
Setup.hs
@@ -391,6 +391,7 @@ extractDarcsVersion distFlag =
|
||||
createDirectoryIfMissing True autogenPath
|
||||
updateFile versionModulePath $ unlines $
|
||||
["module "++modname++" where",
|
||||
"{-# NOINLINE darcs_info #-}",
|
||||
"darcs_info = "++show (either (const (Left ())) Right info)]
|
||||
where
|
||||
dist = fromFlagOrDefault "dist" distFlag
|
||||
|
||||
@@ -41,7 +41,7 @@ data AExp =
|
||||
| AApp AExp AExp Val
|
||||
| AAbs Ident Val AExp
|
||||
| AProd Ident AExp AExp
|
||||
| AEqs [([Exp],AExp)] --- not used
|
||||
-- | AEqs [([Exp],AExp)] --- not used
|
||||
| ARecType [ALabelling]
|
||||
| AR [AAssign]
|
||||
| AP AExp Label Val
|
||||
|
||||
@@ -4,6 +4,7 @@ import System.Info
|
||||
import Data.Version(showVersion)
|
||||
import DarcsVersion_gf
|
||||
|
||||
{-# NOINLINE buildInfo #-}
|
||||
buildInfo =
|
||||
details
|
||||
++"\nBuilt on "++os++"/"++arch
|
||||
|
||||
@@ -177,7 +177,7 @@ execute1 opts gfenv0 s0 =
|
||||
pOpts style q ("-qual" :ws) = pOpts style Qualified ws
|
||||
pOpts style q ws = (style,q,unwords ws)
|
||||
|
||||
(style,q,s) = pOpts TermPrintDefault Qualified (tail (words s0))
|
||||
(style,q,s) = pOpts TermPrintDefault Qualified ws
|
||||
|
||||
case runP pExp (encodeUnicode utf8 s) of
|
||||
Left (_,msg) -> putStrLn msg
|
||||
|
||||
Reference in New Issue
Block a user