summaryrefslogtreecommitdiff
path: root/src/compiler/GF
AgeCommit message (Collapse)Author
2012-10-23cleanuphallgren
Simplify the implementation of writeUTF8File and use it in one more place. Remove unused imports left over after a previous change.
2012-10-19Refactor compileSourceModulehallgren
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.
2012-10-19Consistenly use SourceGrammar instead of [SourceModule] when calling ↵hallgren
compiler passes
2012-10-18Use NOINLINE for build info and darcs version infohallgren
... to avoid unnecessary recompilation of other modules.
2012-10-16GF.Command.Command: turn CommandOutput into a newtypehallgren
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.
2012-10-05Factor out code for setting the console encodinghallgren
Moved similar low-level code blocks in Main and GFI for setting the console encoding to the new module GF.System.Console.
2012-09-28GF shell, show_operations: nicer looking types for linearization functionshallgren
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.
2012-09-27GF shell, show_operations: also show the types of linearization functionshallgren
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...
2012-09-26SIO bug fixhallgren
Line breaks were missing when capturing stdout. (putStrLn acted like putStr.)
2012-09-25Use the SIO monad in the GF shellhallgren
+ 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.
2012-09-25GF.Infra.SIO.hs: adding the SIO monad (where S = Shell or Safe)hallgren
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.
2012-09-25GF.Command.Commands: allCommands is now a constanthallgren
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.
2012-09-18catch all case in GenerateBC.genFunkr.angelov
2012-09-06Add type info to "Warning: ignoring lock fields in resolving..."hallgren
2012-08-30another fix for teyjuskr.angelov
2012-08-29Use nub' instead of nub in some places, remove some unused nub importspeter.ljunglof
2012-08-29Added an O(n log n) version of nubpeter.ljunglof
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.
2012-08-29Emacs only recognizes utf-8, not UTF-8, in file headerspeter.ljunglof
2012-08-29A basic infrastructure for generating Teyjus bytecode from the GF abstract ↵kr.angelov
syntax
2012-08-01the first draft of GF.Compile.Instructionskr.angelov
2012-07-02Minor changes in Python exportpeter.ljunglof
2012-06-28Fixed minor bug in prolog exportpeter.ljunglof
2012-06-27major changes to the prolog exportpeter.ljunglof
2012-06-27cleanup in the python exportpeter.ljunglof
2012-06-26Experiment with parallel grammar checkshallgren
Introduced the function parallelCheck :: [Check a] -> Check [a] that runs independent checks in parallel, potentially allowing faster grammar compilation on multi-core computers, if you run gf with +RTS -N. However, on my dual core laptop, this seems to slow down compilation somewhat even though CPU utilization goes up as high as 170% at times. (This is with GF compiled with GHC 7.0.4.)
2012-06-26GF.Infra.CheckM: comment out unused Context argumenthallgren
2012-06-26Report many type errors instead of stopping after the first onehallgren
In GF.Compile.CheckGrammar, use a new topological sorting function that groups independent judgements, allowing them all to be checked before continuing or reporting errors.
2012-06-25Fix for warning messages from checkMapRecoverhallgren
Reimplemented it with the new function accumulateError. Also keeping the formatting of errors and warnings unchanged for now, to avoid potentially causing problems in the GF Eclipse Plugin.
2012-06-25removed spurious empty warningsaarne
2012-06-25GF.Compile.Rename: report many errors instead of stopping after the first onehallgren
Using accumulated errors in the Check monad. TODO: some errors are still not accumulated, but thanks to checkMapRecover at least one error per judgement is reported.
2012-06-25Check monad: support for accumulated errorshallgren
In addition to warnings, the Check monad in GF.Infra.CheckM can now accumulate errors. There are two new functions checkAccumError: Message -> Check () accumulateError :: (a -> Check a) -> a -> Check a The former (with the same type as checkWarn) is used to report an accumulated (nonfatal) error. The latter converts fatal errors into accumulated errors. Accumulated errors are reported as regular errors by runCheck. Also, the Check monad type has been made abstract.
2012-06-25Export PGF in Python formatpeter.ljunglof
2012-06-25warnings shown in checkMapRecoveraarne
2012-06-25checkMapRecover: find undefined idents in all jments in Renameaarne
2012-06-25printing ResValue judgements as comments, to provide useful information when ↵aarne
a conflict is found between parameter constructors
2012-06-15Add file name to error message when reading a bad .gfo file (in some cases)hallgren
This turns error messages like gf: too few bytes. Failed reading at byte position 1 gf: /some/path/somefile.gfo: too few bytes. Failed reading at byte position 1 but a better fix would be to ignore bad .gfo files and compile from source. The problem is the way this decision is made in GF.Compile.ReadFiles.selectFormat...
2012-06-10command option ma -known to drop unknown wordsaarne
2012-05-30More detailed version info in the startup messagehallgren
The Setup.hs script now queries darcs to create more detailed version info to include in the startup message. Note thought that with distributed version control systems like darcs, the only way to uniquely identify a version is by the set of patches included. Since the patches are not totally ordered, just looking at the last patch is not enough. For official releases, we tag the current set of patches so we can refer to it by name (e.g. RELEASE-3.3.3).
2012-05-15missing case in partial evaluation of + fixedaarne
2012-05-04alex 3 incompatibility workaroundhallgren
As a temporary workaround, alex is no longer invoked automatically when building with cabal. Developers who want to modify the lexer need to run alex on Lexer.x manually and record the modified Lexer.hs. src/compiler/GF/Grammar/lexer/Lexer.x -- hidden from cabal src/compiler/GF/Grammar/Lexer.hs -- update it manually
2012-03-26Workaround for bug in ghc-7.2.2hallgren
An apparent bug in ghc-7.2.2 causes the type Value to be exported from PGF.Data. Workaround: restrict the imports from PGF.Data in GF.Command.Abstract and GF.Compile.GeneratePMCFG to avoid the clash with locally defined type Value. (ghc-7.0.4 and ghc-7.4.1 appear to be free from this bug.)
2012-03-26compiler/GF/Text/Coding.hs: fix build failure against ghc-7.2Sergei Trofimovich
2012-02-28bug fix in AppPredefined: don't compare values that contain variables. this ↵aarne
should be checked even more generally.
2012-02-28buf fix in the compiler for HOASkr.angelov
2012-02-24the Predef function eqVal to compare equality of parameter valuesaarne
2012-02-23hindi-resource-grammarvirk.shafqat
2012-02-22gfse: experimental support for editing concrete syntax in text modehallgren
2012-02-21sindhipatchvirk.shafqat
2012-02-20GF.Inra.UseIO: add instance Functor IOE, add method fail to instance Monad IOEhallgren
2012-01-14sorted the list of funs and cats in GrammatToPGF to get the predef ↵aarne
categories in proper place and get gr, ai, gt work properly