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