| Age | Commit message (Collapse) | Author |
|
Int was missing from the list of predefined canonical constants.
|
|
are always listed in decreasing probability order. There is also an API for generation from Python
|
|
FlexibleInstances does not imply TypeSynonymInstances, apparently.
|
|
The work done by the partial evaluator is now divied in two stages:
- A static "term traversal" stage that happens only once per term and uses
only statically known information. In particular, the values of lambda bound
variables are unknown during this stage. Some tables are transformed to
reduce the cost of pattern matching.
- A dynamic "function application" stage, where function bodies can be
evaluated repeatedly with different arguments, without the term traversal
overhead and without recomputing statically known information.
Also the treatment of predefined functions has been reworked to take advantage
of the staging and better handle partial applications.
|
|
* Evaluate operators once, not every time they are looked up
* Remember the list of parameter values instead of recomputing it from the
pattern type every time a table selection is made.
* Quick fix for partial application of some predefined functions.
|
|
Also adding a test case in the test suite for this.
|
|
* -new-comp (the new partial evaluator) is now chosen by default when you run
cabal install (or cabal configure). To revert to using the old partial
evaluator by default, use "cabal install -f-new-comp" (or
"cabal configure -f-new-comp").
* Regardless of the configured default, you can choose which partial evaluator
to use when you invoke gf by using the -new-comp or -old-comp command line
option.
* The cc command in the GF shell uses the chosen partial evaluator by default,
but you can override this by using "cc -new" or "cc -old".
The plan is that these flags will be romeved in a future version.
|
|
More changes are probably needed to make pattern macros first class values.
Also includes minor changes related to variants and error messages.
|
|
GrammarToPGF, to help find compilation errors; the ones I've found are because an inherited abstract excludes something that the inherited concrete does not exclude.
|
|
|
|
|
|
The pretty printer produced
mkDet pre {"a"; "an" / vowel} Sg
which is not accepted by the parser. The parser assigns pre { ... }, to
prededence level 4, and this is now reflected in the pretty printer, so
it prints
mkDet (pre {"a"; "an" / vowel}) Sg
(This caused a problem in GFSE since it parsers pretty printed grammars...)
|
|
|
|
With this change, all languages in molto/mgl/mixture except German and Polish
can be compiled.
|
|
This can make it easier to test cloud service updates before installing them.
|
|
Change the command name from gfc to gf in the usage message header.
Correct spelling of "overide" to "override" in -gf-lib-path description.
|
|
GF.Compile.Compute.ConcreteNew + two new modules contain a new
partial evaluator intended to solve some performance problems with the old
partial evalutator in GF.Compile.Compute.ConcreteLazy. It has been around for
a while, but is now complete enough to compile the RGL and the Phrasebook.
The old partial evaluator is still used by default. The new one can be activated
in two ways:
- by using the command line option -new-comp when invoking GF.
- by using cabal configure -fnew-comp to make -new-comp the default. In this
case you can also use the command line option -old-comp to revert to the old
partial evaluator.
In the GF shell, the cc command uses the old evaluator regardless of -new-comp
for now, but you can use "cc -new ..." to invoke the new evaluator.
With -new-comp, computations happen in GF.Compile.GeneratePMCFG instead of
GF.Compile.Optimize. This is implemented by testing the flag optNewComp in
both modules, to omit calls to the old partial evaluator from GF.Compile.Optimize
and add calls to the new partial evaluator in GF.Compile.GeneratePMCFG.
This also means that -new-comp effectively implies -noexpand.
In GF.Compile.CheckGrammar, there is a check that restricted inheritance is used
correctly. However, when -noexpand is used, this check causes unexpected errors,
so it has been converted to generate warnings, for now.
-new-comp no longer enables the new type checker in
GF.Compile.Typeckeck.ConcreteNew.
The GF version number has been bumped to 3.3.10-darcs
|
|
This is also needed for compatibility with GHC 7.6.
|
|
|
|
GF.Data.Utilities: Rename mapFst to apFst, mapSnd to apSnd.
Add apBoth, mapFst, mapSnd, mapBoth.
GF.Data.Operations: Remove onSnd (same as apSnd)
|
|
compiling grammars
For example, you can add -optimize-pgf:
http://localhost:41296/cloud?dir=...&command=remake&-optimize-pgf=&Foods2Eng.gf=&Foods2Swe.gf=
|
|
|
|
collectPattOp :: (Patt -> [a]) -> Patt -> [a]
|
|
For Patt, analogous to composOp for Term.
|
|
Also add a missing check for Predef values in apply.
|
|
Just to make them easier to spot when wading through thousands of lines of
warnings...
|
|
grammars
Also remove some old commented out code.
|
|
Simplify the implementation of writeUTF8File and use it in one more place.
Remove unused imports left over after a previous change.
|
|
There was 55 lines of rather repetitive code with calls to 6 compiler passes.
They have been replaced with 19 lines that call the 6 compiler passes
plus 26 lines of helper functions.
|
|
compiler passes
|
|
... to avoid unnecessary recompilation of other modules.
|
|
The output from commands is represented as ([Expr],String), where the [Expr] is
used when data is piped between commands and the String is used for the final
output. The String can represent the same list of trees as the [Expr] and/or
contain diagnostic information.
Sometimes the data that is piped between commands is not a list of trees, but
e.g. a string or a list of strings. In those cases, functions like fromStrings
and toStrings are used to encode the data as a [Expr].
This patch introduces a newtype for CommandOutput and collects the functions
dealing with command output in one place to make it clearer what is going on.
It also makes it easier to change to a more direct representation of piped
data, and make pipes more "type safe", if desired.
|
|
This enables the use of arbitrary Unicode character in text mode in GFSE.
|
|
Moved similar low-level code blocks in Main and GFI for setting the console
encoding to the new module GF.System.Console.
|
|
|
|
Adding a lock field to the result type of linearization functions.
TODO: figure out how to add a lock field to the argument types too.
|
|
This is a simple change in GF.Grammar.Lookup.allOpers, which is used only in
the implementation of the show_operations command in the shell.
This is useful when importing a concrete syntax (like LexiconEng) as a resource.
However, the types don't always look as nice as I hoped...
|
|
Line breaks were missing when capturing stdout. (putStrLn acted like putStr.)
|
|
GF version info can now be obtained from http://localhost:41926/version
Also removed some unused imports.
|
|
+ The restrictions on arbitrary IO when GF is running in restricted mode is now
enforced in the types.
+ This hopefully also solves an intermittent problem when accessing the GF
shell through the web API provided by gf -server. This was visible in the
Simple Translation Tool and probably caused by some low-level bug in the
GHC IO libraries.
|
|
The SIO monad is a restriction of the IO monad with two purposes:
+ Access to arbitrary IO operations can be turned off by setting the environment
variable GF_RESTRICTED. There is a limited set of IO operations that are
considered safe and always allowed.
+ It allows output to stdout to be captured. This can be used in gf -server
mode, where output of GF shell commands is made part of HTTP responses
returned to clients.
|
|
The dependency on PGFEnv has been moved from the list to the exec function of
the commands in the list. This means that the help command no longer needs
to generate a new list of commands and that the state of the shell
(type GF.Command.Interpreter.CommandEnv) no longer needs to contain the list
of commands.
|
|
Use a monad in the request handler to make the code a bit more modular and
readable.
|
|
|
|
+ More restrictive limits on which file paths can be downloaded and removed.
+ Add more extensions to the list of file types that may be removed. In
particular, allow documents created by simple translation tool to be removed.
|
|
|
|
|
|
|
|
|
|
The new nub is called nub', and it replaces the old sortNub which was
not lazy and did not retain the order between the elements.
|