From e66aab0978dc4652ee9df3160dcd1f5fbe3bdb79 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 9 Nov 2007 10:08:07 +0000 Subject: changed js and hs file names in gfcc output to expected ones --- src/GF/Devel/GFC.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/GF/Devel') diff --git a/src/GF/Devel/GFC.hs b/src/GF/Devel/GFC.hs index 0c352bbb7..1e66d29a5 100644 --- a/src/GF/Devel/GFC.hs +++ b/src/GF/Devel/GFC.hs @@ -16,7 +16,7 @@ main = do xx <- getArgs let (opts,fs) = getOptions "-" xx case opts of - _ | oElem (iOpt "help") opts -> putStrLn "usage: gfc (--make) FILES" + _ | oElem (iOpt "help") opts -> putStrLn usageMsg _ | oElem (iOpt "-make") opts -> do gr <- batchCompile opts fs let name = justModuleName (last fs) @@ -50,14 +50,20 @@ file2gfcc f = ---- TODO: nicer and richer print options -alsoPrint opts abs gr (opt,suff) = +alsoPrint opts abs gr (opt,name) = if oElem (iOpt opt) opts then do - let outfile = abs ++ "." ++ suff + let outfile = name let output = prGFCC opt gr writeFile outfile output putStrLn $ "wrote file " ++ outfile else return () -printOptions = [("haskell","hs"),("haskell_gadt","hs"),("js","js")] +printOptions = [ + ("haskell","GSyntax.hs"), + ("haskell_gadt","GSyntax.hs"), + ("js","grammar.js") + ] +usageMsg = + "usage: gfc (-h | --make (-noopt) (-js | -haskell | -haskell_gadt)) (-src) FILES" -- cgit v1.2.3