forked from GitHub/gf-core
-s
This commit is contained in:
@@ -84,11 +84,12 @@ compileModule opts st0 file |
|
||||
compileModule opts1 st0 file = do
|
||||
opts0 <- ioeIO $ getOptionsFromFile file
|
||||
let useFileOpt = maybe False (const True) $ getOptVal opts0 pathList
|
||||
let useLineOpt = maybe False (const True) $ getOptVal opts1 pathList
|
||||
let opts = addOptions opts1 opts0
|
||||
let fpath = justInitPath file
|
||||
let ps0 = pathListOpts opts fpath
|
||||
|
||||
let ps1 = if useFileOpt
|
||||
let ps1 = if (useFileOpt && not useLineOpt)
|
||||
then (map (prefixPathName fpath) ps0)
|
||||
else ps0
|
||||
ps <- ioeIO $ extendPathEnv gfGrammarPathVar ps1
|
||||
|
||||
@@ -35,8 +35,9 @@ getAllFiles opts ps env file = do
|
||||
-- read module headers from all files recursively
|
||||
ds0 <- getImports ps file
|
||||
let ds = [((snd m,map fst ms),p) | ((m,ms),p) <- ds0]
|
||||
ioeIO $ putStrLn $ "all modules:" +++ show (map (fst . fst) ds)
|
||||
|
||||
if oElem beSilent opts
|
||||
then return ()
|
||||
else ioeIO $ putStrLn $ "all modules:" +++ show (map (fst . fst) ds)
|
||||
-- get a topological sorting of files: returns file names --- deletes paths
|
||||
ds1 <- ioeErr $ either
|
||||
return
|
||||
|
||||
@@ -208,7 +208,7 @@ putStrE = ioeIO . putStrFlush
|
||||
|
||||
putPointE :: Options -> String -> IOE a -> IOE a
|
||||
putPointE opts msg act = do
|
||||
let ve x = if oElem beVerbose opts then x else return ()
|
||||
let ve x = if oElem beSilent opts then return () else x
|
||||
ve $ ioeIO $ putStrFlush msg
|
||||
a <- act
|
||||
--- ve $ ioeIO $ putShow' id a --- replace by a statistics command
|
||||
|
||||
@@ -126,11 +126,11 @@ execCommand env c s = case c of
|
||||
|
||||
-- these commands do need IO
|
||||
CCEnvImport file -> useIOE (env,s) $ do
|
||||
st <- shellStateFromFiles opts env file
|
||||
st <- shellStateFromFiles optss env file
|
||||
return (st,s)
|
||||
|
||||
CCEnvEmptyAndImport file -> useIOE (emptyShellState, initSState) $ do
|
||||
st <- shellStateFromFiles opts emptyShellState file
|
||||
st <- shellStateFromFiles optss emptyShellState file
|
||||
return (startEditEnv st,initSState)
|
||||
|
||||
CCEnvEmpty -> do
|
||||
@@ -180,6 +180,7 @@ execCommand env c s = case c of
|
||||
gr = grammarCEnv env
|
||||
cgr = canCEnv env
|
||||
opts = globalOptions env
|
||||
optss = addOption beSilent opts
|
||||
|
||||
-- format for documents:
|
||||
-- GF commands of form "-- command", then term or text
|
||||
|
||||
@@ -21,7 +21,7 @@ import UTF8
|
||||
sessionLineJ :: Bool -> ShellState -> IO ()
|
||||
sessionLineJ isNew env = do
|
||||
putStrLnFlush $ initEditMsgJavaX env
|
||||
let env' = addGlobalOptions (options [sizeDisplay "short"]) env
|
||||
let env' = addGlobalOptions (options [sizeDisplay "short",beSilent]) env
|
||||
editLoopJnewX isNew env' (initSState)
|
||||
|
||||
-- this is the real version, with XML
|
||||
|
||||
@@ -17,7 +17,7 @@ type SState = [(State,([Exp],[Clip]),SInfo)] -- exps: candidate refinements,clip
|
||||
type SInfo = ([String],(Int,Options)) -- string is message, int is the view
|
||||
|
||||
initSState :: SState
|
||||
initSState = [(initState, ([],[]), (["Select category to start"],(0,noOptions)))]
|
||||
initSState = [(initState, ([],[]), (["Select 'New' category to start"],(0,noOptions)))]
|
||||
-- instead of empty
|
||||
|
||||
type Clip = Tree ---- (Exp,Type)
|
||||
|
||||
Reference in New Issue
Block a user