This quick fix should make Ctrl-C in the GF shell behave more like it does in
other shells: even if no command is running, Ctrl-C now just gives you a new
prompt instead of terminating the shell.
Work in progress on making the online grammar editor use the new "gf -server"
mode instead of the old upload.cgi script. A first benefit is that the
editor now calls the server to check the syntax of lin & lincat definitions.
(But the links to minibar/gfshell/quiz are not available at the moment.)
The command "gf -server" now starts a simple HTTP server on port 41295,
providing a simple web API to the GF compiler. It currently support the
follwing operations:
* creating new temporary directories for grammar uploads,
* uploading grammars files for use in the GF shell,
* executing GF shell commands, and
* accessing static files.
This means that GF now depends on some additional networking related packages,
but they should be available and easy to install on all platforms. There is
also a new configuration flag "server" in gf.cabal, so GF will be compiled
without support for server mode if the extra packages are unavailable.
Note that running gf -server while connected to the internet can be a security
risk. To prevent unauthorized access to the rest of the system, it is
advisable to run the server in GF_RESTRICTED mode and as a user with suitably
restricted file permissions.
The GF shell welcome message will now include something like
This is GF version 3.2.1-darcs.
Built on darwin/i386 with ghc-7.0, flags: interrupt
where a list of enabled configuration flags are included on the last line.
This is implemented in GF.Infra.BuildInfo by consulting the CPP macros
defined by the respective option in gf.cabal. For this to work,
GF.Infra.BuildInfo obviously has to be updated when new flags are added to
gf.cabal or if the CPP macros are renamed.
(Also, I suspect that if you reconfigure with different flags and rebuild GF
without cleaning first, the BuildInfo module will not be recompiled,
resulting in a misleading welcome message...)
On touch-based devices, the on-screen keyboard kept popping up after every word,
which was very annoying if you were entering a sentence by tapping on the
magnets.
When adding a new concrete syntax to a grammar, the currently open concrete
syntax will be copied. If the abstract syntax is currently open, the new
concrete syntax will start out empty.
By setting the environment variable GF_RESTRICTED before starting GF, the shell
will be run in restricted mode. This will prevent the GF shell from starting
arbitrary system commands (most uses of System.Cmd.system are blocked) and
writing arbitrary files (most commands that use writeFile et al are blocked).
Restricted mode is intended minimize the potential security risks involved
in allowing public access to the GF shell over the internet. It should be used
in conjuction with system level protection mechanisms (e.g. file permissions)
to make sure that a publicly acessible GF shell does not give access to parts
of the system that should not be publicly accessible.
I changed the version number to 3.2.1-darcs.
I think the version number of the current version from darcs should always
include the "-darcs" suffix (or "-current" perhaps?). The suffix should be
removed only momentarily when making an official release.