diff --git a/lib/resource/Make.hs b/lib/resource/Make.hs index 4bbab08cc..02094c98c 100644 --- a/lib/resource/Make.hs +++ b/lib/resource/Make.hs @@ -39,19 +39,19 @@ langsCoding = [ langs = map fst langsCoding -- languagues for which to compile Lang -langsLang = langs `except` ["Ara"] +langsLang = langs -- languages for which to compile Try -langsAPI = langsLang `except` ["Bul","Cat","Hin","Ina","Rus","Tha"] +langsAPI = langsLang `except` ["Ara","Bul","Cat","Hin","Ina","Rus","Tha"] -- languages for which to compile Mathematical langsMath = langsAPI -- languages for which to run treebank test -langsTest = langsLang `except` ["Bul","Cat","Hin","Rus","Spa","Tha"] +langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Rus","Spa","Tha"] -- languages for which to run demo test -langsDemo = langsLang `except` ["Hin","Ina","Tha"] +langsDemo = langsLang `except` ["Ara","Hin","Ina","Tha"] -- languages for which langs.pgf is built langsPGF = langsTest `only` ["Eng","Fre","Swe"] @@ -78,7 +78,7 @@ make xx = do mapM_ (gfc pres presApiPath . try) (optl langsAPI) system $ "cp */*.gfo " ++ dir ifx "math" $ do - mapM_ (gfc False [] . math) (optl langsMath) + mapM_ (gfc_stack mathstack False [] . math) (optl langsMath) system $ "cp mathematical/*.gfo ../mathematical" mapM_ (gfc False [] . symbolic) (optl langsMath) system $ "cp mathematical/Symbolic*.gfo ../mathematical" @@ -93,7 +93,7 @@ make xx = do let ls = optl langsDemo gf (demos "Demo" ls) $ unwords ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls] ifxx "clean" $ do - system "rm */*.gfo ../alltenses/*.gfo ../present/*.gfo" + system "rm -f */*.gfo ../alltenses/*.gfo ../present/*.gfo" ifxx "clone" $ do let (pref,lang) = case getLangName xx of Just pl -> pl @@ -102,11 +102,15 @@ make xx = do mapM_ (\la -> writeFile (pref ++ la ++ ".gf") (replaceLang lang la s)) (map snd (optl langs)) return () -gfc pres ppath file = do +gfc_stack stack pres ppath file = do let preproc = if pres then " -preproc=./mkPresent " else "" let path = if pres then ppath else "" putStrLn $ "compiling " ++ file - system $ "gfc -s -src " ++ preproc ++ path ++ file + system $ "gfc -s -src " ++ preproc ++ path ++ file ++ stack + +gfc = gfc_stack "" + +mathstack = " +RTS -K100M" gf comm file = do putStrLn $ "reading " ++ file diff --git a/src/GF/Command/Abstract.hs b/src/GF/Command/Abstract.hs index 29111b432..1ae5d6dff 100644 --- a/src/GF/Command/Abstract.hs +++ b/src/GF/Command/Abstract.hs @@ -65,3 +65,10 @@ prOpt o = case o of mkOpt :: String -> Option mkOpt = OOpt +-- abbreviation convention from gf commands +getCommandOp s = case break (=='_') s of + (a:_,_:b:_) -> [a,b] -- axx_byy --> ab + _ -> case s of + [a,b] -> s -- ab --> ab + a:_ -> [a] -- axx --> a + diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs index e161c623f..29f0bd61a 100644 --- a/src/GF/Command/Commands.hs +++ b/src/GF/Command/Commands.hs @@ -23,6 +23,7 @@ import GF.Infra.UseIO import GF.Data.ErrM ---- import PGF.Expr (readTree) import GF.Command.Abstract +import GF.Command.Messages import GF.Text.Lexing import GF.Text.Transliterations @@ -193,10 +194,16 @@ allCommands enc pgf = Map.fromList [ "Without argument, shows the synopsis of all commands." ], options = [ - ("full","give full information of the commands") + ("changes","give a summary of changes from GF 2.9"), + ("coding","give advice on character encoding"), + ("full","give full information of the commands"), + ("license","show copyright and license information") ], exec = \opts ts -> return ([], case ts of - [t] -> let co = showTree t in + _ | isOpt "changes" opts -> changesMsg + _ | isOpt "coding" opts -> codingMsg + _ | isOpt "license" opts -> licenseMsg + [t] -> let co = getCommandOp (showTree t) in case lookCommand co (allCommands enc pgf) of ---- new map ??!! Just info -> commandHelp True (co,info) _ -> "command not found" @@ -612,3 +619,5 @@ infinity = 256 lookFlag :: PGF -> String -> String -> Maybe String lookFlag pgf lang flag = lookConcrFlag pgf (mkCId lang) (mkCId flag) + + diff --git a/src/GF/Command/Interpreter.hs b/src/GF/Command/Interpreter.hs index db4192001..f4e3e220d 100644 --- a/src/GF/Command/Interpreter.hs +++ b/src/GF/Command/Interpreter.hs @@ -116,10 +116,3 @@ getCommandArg env a ts = case a of ATree t -> [t] -- ignore piped ANoArg -> ts -- use piped --- abbreviation convention from gf commands -getCommandOp s = case break (=='_') s of - (a:_,_:b:_) -> [a,b] -- axx_byy --> ab - _ -> case s of - [a,b] -> s -- ab --> ab - a:_ -> [a] -- axx --> a - diff --git a/src/GF/Command/Messages.hs b/src/GF/Command/Messages.hs new file mode 100644 index 000000000..8dda92d49 --- /dev/null +++ b/src/GF/Command/Messages.hs @@ -0,0 +1,54 @@ +module GF.Command.Messages where + +licenseMsg = unlines [ + "Copyright (c)", + "Krasimir Angelov, Bj\246rn Bringert, H\229kan Burden, Hans-Joachim Daniels,", + "Markus Forsberg, Thomas Hallgren, Harald Hammarstr\246m, Kristofer Johannisson,", + "Janna Khegai, Peter Ljungl\246f, Petri M\228enp\228\228, and", + "Aarne Ranta, 1998-2008, under GNU General Public License (GPL)", + "see LICENSE in GF distribution, or http://www.gnu.org/licenses/gpl.html." + ] + +codingMsg = unlines [ + "The GF shell uses Unicode internally, but assumes user input to be UTF8", + "and converts terminal and file output to UTF8. If your terminal is not UTF8", + "see 'help set_encoding." + ] + +changesMsg = unlines [ + "While GF 3.0 is backward compatible with source grammars, the shell commands", + "have changed from version 2.9. Below the most importand changes. Bug reports", + "and feature requests should be sent to http://trac.haskell.org/gf/.", + "", + "af use wf -append", + "at not supported", + "eh not yet supported", + "es no longer supported; use javascript generation", + "g not yet supported", + "l now by default multilingual", + "ml not yet supported", + "p now by default multilingual", + "pi not yet supported", + "pl not yet supported", + "pm subsumed to pg", + "po not yet supported", + "pt not yet supported", + "r not yet supported", + "rf changed syntax", + "rl not supported", + "s no longer needed", + "sa not supported", + "sf not supported", + "si not supported", + "so not yet supported", + "t use pipe with l and p", + "tb use l -treebank", + "tl not yet supported", + "tq changed syntax", + "ts not supported", + "tt use ps", + "ut not supported", + "vg not yet supported", + "wf changed syntax", + "wt not supported" + ] diff --git a/src/GFI.hs b/src/GFI.hs index ee4d8809f..18fc4143f 100644 --- a/src/GFI.hs +++ b/src/GFI.hs @@ -147,7 +147,9 @@ welcome = unlines [ " * * * ", " ", "This is GF version "++showVersion version++". ", - "Some things may work. " + "License: see help -license. ", + "Differences from GF 2.9: see help -changes.", + "Bug reports: http://trac.haskell.org/gf/" ] prompt env = absname ++ "> " where diff --git a/src/Makefile b/src/Makefile index 14a2c54ad..eb645642b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,11 +30,9 @@ EMBED = GF/Embed/TemplateApp # use the temporary binary file name 'gf-bin' to not clash with directory 'GF' # on case insensitive file systems (such as FAT) -GF_EXE=gf3$(EXEEXT) +GF_EXE=gf$(EXEEXT) GF_EXE_TMP=gf-bin$(EXEEXT) GF_DOC_EXE=gfdoc$(EXEEXT) -GF3_EXE=gf3$(EXEEXT) -TESTGF3_EXE=testgf3$(EXEEXT) ifeq ("$(READLINE)","readline") @@ -65,9 +63,9 @@ endif .PHONY: all unix jar tags gfdoc windows install install-gf \ lib temp install-gfdoc install-editor \ - today help clean windows-msi dist + today help clean windows-msi dist gfc -all: unix gfdoc $(BUILD_JAR) lib +all: unix gfc lib static: GHCFLAGS += -optl-static static: unix @@ -82,7 +80,6 @@ windows: unix temp: today noopt - build: $(GHMAKE) $(GHCFLAGS) GF.hs -o $(GF_EXE_TMP) strip $(GF_EXE_TMP) @@ -98,28 +95,8 @@ embed: noopt: build -ghci: ghci-nofud - -fud: - $(GHCXMAKE) $(GHCFLAGS) $(GHCFUDFLAG) GF.hs -o fgf - strip fgf - mv fgf ../bin/ - -gft: - $(GHMAKE) $(GHCFLAGS) -itranslate translate/GFT.hs -o gft-bin - strip gft-bin - mv gft-bin ../bin/gft - -api: - $(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS) GF/API.hs - -shell: - $(GHMAKE) $(GHCFLAGS) $(GHCOPTFLAGS) GF/Shell.hs - clean: find . '(' -name '*~' -o -name '*.hi' -o -name '*.ghi' -o -name '*.o' ')' -exec rm -f '{}' ';' - -rm -f JavaGUI/*.class - -rm -f $(GFEDITOR)/de/uka/ilkd/key/ocl/gf/*.class -rm -f gf.wixobj -rm -f ../bin/$(GF_EXE) $(MAKE) -C tools/c clean @@ -127,32 +104,20 @@ clean: -rm -f ../bin/gfcc2c distclean: clean - -rm -f JavaGUI/gf-java.jar jgf - -rm -f $(GFEDITOR)/gfeditor.jar jgf -rm -f tools/$(GF_DOC_EXE) -rm -f config.status config.mk config.log -rm -f *.tgz *.zip -rm -rf $(DIST_DIR) $(BIN_DIST_DIR) -rm -rf gf.wxs *.msi -ghci-nofud: - $(GHCI) $(GHCFLAGS) - today: echo 'module Paths_gf (version, getDataDir) where' > Paths_gf.hs echo 'import Data.Version' >> Paths_gf.hs echo '{-# NOINLINE version #-}' >> Paths_gf.hs echo 'version :: Version' >> Paths_gf.hs - echo 'version = Version {versionBranch = [3,0], versionTags = ["alpha"]}' >> Paths_gf.hs + echo 'version = Version {versionBranch = [3,0], versionTags = ["beta"]}' >> Paths_gf.hs echo 'getDataDir = return "$(GF_DATA_DIR)" :: IO FilePath' >> Paths_gf.hs -javac: - $(JAVAC) $(JAVAFLAGS) -classpath $(GFEDITOR)/jargs-1.0.jar $(GFEDITOR)/de/uka/ilkd/key/ocl/gf/*.java - $(JAVAC) $(JAVAFLAGS) JavaGUI/*.java - -jar: javac - cd JavaGUI; $(JAR) -cmf manifest.txt gf-java.jar *.class ; cd .. - cd $(GFEDITOR) ; rm -rf jarcontents ; mkdir jarcontents ; cp -r de ManifestMain.txt ../../LICENSE LICENCE_jargs gf-icon.gif jarcontents ; cat jargs-1.0.jar | (cd jarcontents; jar -x jargs) ; cd jarcontents ; $(JAR) -cmf ManifestMain.txt ../gfeditor.jar de/uka/ilkd/key/ocl/gf/*.class jargs LICENSE LICENCE_jargs gf-icon.gif ; cd .. ; cd .. showflags: @echo $(GHCFLAGS) @@ -196,22 +161,11 @@ gfdoc: tools/$(GF_DOC_EXE) tools/$(GF_DOC_EXE): tools/GFDoc.hs $(GHMAKE) $(GHCOPTFLAGS) -o $@ $^ -gfc: gf3 +gfc: gf + echo GFC! cp -f gfc ../bin/ chmod a+x ../bin/gfc -gfi: gf3 - -gf3: - $(GHMAKE) $(GHCOPTFLAGS) $(GHCFLAGS) -o gf3 GF.hs - strip $(GF3_EXE) - mv $(GF3_EXE) ../bin/ - -testgf3: - $(GHMAKE) $(GHCOPTFLAGS) -o testgf3 GF/Devel/TestGF3.hs - strip $(TESTGF3_EXE) - mv $(TESTGF3_EXE) ../bin/ - gfcc2c: $(MAKE) -C tools/c $(MAKE) -C ../lib/c @@ -222,7 +176,7 @@ gfcc2c: # lib: - $(MAKE) -C ../lib/resource clean new + $(MAKE) -C ../lib/resource clean all # # Distribution @@ -292,11 +246,6 @@ install-gf: $(INSTALL) -d $(bindir) $(INSTALL) ../bin/$(GF_EXE) $(bindir) -install-gf3: - $(INSTALL) -d $(bindir) - $(INSTALL) ../bin/$(GF3_EXE) $(bindir) - $(INSTALL) ../bin/gfc $(bindir) - install-gfdoc: $(INSTALL) -d $(bindir) $(INSTALL) tools/$(GF_DOC_EXE) $(bindir)