mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-12 12:42:50 -06:00
fixed reading argvars from gfc in gf-to-gfcc
This commit is contained in:
@@ -3,6 +3,7 @@ module Main where
|
||||
import GF.Devel.Compile
|
||||
import GF.Devel.GrammarToGFCC
|
||||
import GF.Devel.UseIO
|
||||
import GF.Infra.Option
|
||||
---import GF.Devel.PrGrammar ---
|
||||
|
||||
import System
|
||||
@@ -10,15 +11,16 @@ import System
|
||||
|
||||
main = do
|
||||
xx <- getArgs
|
||||
case xx of
|
||||
"-help":[] -> putStrLn "usage: gfc (--make) FILES"
|
||||
"--make":fs -> do
|
||||
gr <- batchCompile fs
|
||||
let (opts,fs) = getOptions "-" xx
|
||||
case opts of
|
||||
_ | oElem (iOpt "help") opts -> putStrLn "usage: gfc (--make) FILES"
|
||||
_ | oElem (iOpt "-make") opts -> do
|
||||
gr <- batchCompile opts fs
|
||||
let name = justModuleName (last fs)
|
||||
let (abs,gc) = prGrammar2gfcc name gr
|
||||
let target = abs ++ ".gfcc"
|
||||
writeFile target gc
|
||||
putStrLn $ "wrote file " ++ target
|
||||
_ -> do
|
||||
mapM_ batchCompile (map return xx)
|
||||
mapM_ (batchCompile opts) (map return fs)
|
||||
putStrLn "Done."
|
||||
|
||||
Reference in New Issue
Block a user