diff --git a/doc/gf-history.html b/doc/gf-history.html index 98a40bba3..1f0b81ad3 100644 --- a/doc/gf-history.html +++ b/doc/gf-history.html @@ -14,6 +14,24 @@ Changes in functionality since May 17, 2005, release of GF Version 2.2

+10/6 (AR) Preprocessor of .gfe files can now be performed as part of +any grammar compilation. The flag -ex causes GF to look for +the .gfe files and preprocess those that are younger +than the corresponding .gf files. The files are first sorted +and group by the resource, so that each resource only need be compiled once. + +

+ +10/6 (AR) Editor GUI can now be alternatively invoked by the shell +command gf -edit (equivalent to jgf). + +

+ +10/6 (AR) Editor GUI command pc Int to pop Int +items from the clip board. + +

+ 4/6 (AR) Sequence of commands in the Java editor GUI now possible. The commands are separated by ;; (notice the space on both sides of the two semicolons). Such a sequence can be sent diff --git a/src/GF.hs b/src/GF.hs index 96cf33661..ed07ede8b 100644 --- a/src/GF.hs +++ b/src/GF.hs @@ -5,9 +5,9 @@ -- Stability : (stability) -- Portability : (portability) -- --- > CVS $Date: 2005/06/03 21:51:58 $ +-- > CVS $Date: 2005/06/10 21:04:01 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.27 $ +-- > CVS $Revision: 1.28 $ -- -- The Main module of GF program. ----------------------------------------------------------------------------- @@ -20,6 +20,7 @@ import GF.Infra.UseIO import GF.Infra.Option import GF.API.IOGrammar import GF.Compile.ShellState +import GF.Compile.Compile import GF.Compile.MkConcrete import GF.Shell import GF.Shell.SubShell @@ -30,19 +31,22 @@ import GF.Text.UTF8 import GF.Today (today,version) import GF.System.Arch -import System (getArgs) -import Control.Monad (foldM) +import System (getArgs,system) +import Control.Monad (foldM,liftM) +import Data.List (nub) -- AR 19/4/2000 -- 28/4/2005 main :: IO () main = do xs <- getArgs - let (os,fs) = getOptions "-" xs - opt j = oElem j os - st0 = optInitShellState os - ifNotSil c = if oElem beSilent os then return () else c - case 0 of + let + (os,fs) = getOptions "-" xs + opt j = oElem j os + st0 = optInitShellState os + ifNotSil c = if oElem beSilent os then return () else c + + doGF os fs = case 0 of _ | opt getHelp -> do putStrLnFlush $ encodeUTF8 helpMsg @@ -62,6 +66,10 @@ main = do _ | opt makeConcrete -> do mkConcretes fs + _ | opt openEditor -> do + system $ "jgf" +++ unwords xs + return () + _ | opt doBatch -> do if opt beSilent then return () else putStrLnFlush "" st <- useIOE st0 $ @@ -77,17 +85,26 @@ main = do if null fs then return () else (ifNotSil putCPU) gfInteract (initHState st) return () + -- preprocessing gfe + if opt fromExamples + then do + es <- liftM (nub . concat) $ mapM (getGFEFiles os) fs + mkConcretes es + doGF (removeOption fromExamples os) fs + else doGF os fs helpMsg = unlines [ "Usage: gf