summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Compute
AgeCommit message (Collapse)Author
2017-03-07GF.Compile.Compute.ConcreteNew now handles Predef.Floatkrasimir
2017-03-06GF.Compile.Compute.ConcreteNew now can handle EPattTypekrasimir
2016-03-15more progress on the typecheckerkrasimir
2016-03-07current state of the experimental typecheckerkrasimir
2016-03-03add missing cases in vapply in the partial evaluatorkrasimir
2016-03-02fix in the typecheckerkrasimir
2016-03-02a better interface between the type checker and the partial evaluatorkrasimir
2016-03-02the experimental type checker in GF.Compile.TypeCheck.ConcreteNew is now ↵krasimir
rewriten to use the complete evaluator in GF.Compile.Compute.ConcreteNew. The old sketchy implementation in GF.Compile.Compute.ConcreteNew1 is now removed.
2015-12-02GF shell, cc command: try to compute pre{...} tokens in token sequenceshallgren
This is implemented as a simple post-processing step after partial evaluation to try compute pre{...} tokens in token sequences. Nothing is done to deal with intervening free variants. This was done in response to a query from René T on the gf-dev mailing list.
2015-09-30cc -trace: don't try to show the bodies of lambda abstractionshallgren
This triggers evaluation of terms with free variables, which the partial evaluator isn't equipped to handle. Reported by Aarne.
2015-09-28Preliminary new shell feature: cc -trace.hallgren
You can now do things like cc -trace mkV "debug" to see a trace of all opers with their arguments and results during the computation of mkV "debug".
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
2015-05-11added all orthographic primitiveskrasimir
2015-03-05remove some more old codekrasimir
2015-03-04GF.Compile.Compute.ConcreteNew: add dynamic table conversionhallgren
If the enumaration of table parameter values fails during the static traversal phase, try again in the dynamic computation phase, when the values of bound variables are known. This is necessary to properly deal with generic table construction in opers, like the ones found in prelude/Coordination.gf, e.g. consTable : (P : PType) -> ... = \P ... -> {s1 = table P {...} ; ... }
2015-03-04GF.Compile.Compute.ConcreteNew: some refactoring for readabilityhallgren
2015-02-20added option -plus-as-bind which treats (+) as a bind when used with runtime ↵krasimir
variables
2015-02-16Changes for compatibility with ghc-7.10-rc2hallgren
2 modules: Name clashes caused by Applicative-Monad change in Prelude 2 modules: Ambiguities caused by Foldable/Traversable in Prelude 2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale 9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types now, in addition to explicitly given type signatures) Also silenced warnings about tab characters in source files.
2014-12-05Eliminate the record extension operator from the Value type returned by the ↵hallgren
partial evaluator It was used only in cases where a lock field needed to be added to a run-time variable, like e.g. in examples/phrasebook/SentencesTha.gf: lin PGreetingMale g = mkText (lin Text g) (lin Text (ss "ครับ")) | g ; PGreetingFemale g = mkText (lin Text g) (lin Text (ss "ค่ะ")) | g ; But lock fields are only meaningful during type checking and can safely be ignored in later passes.
2014-10-21ModuleName and Ident are now distinct typeshallgren
This makes the documentation clearer, and can potentially catch more programming mistakes.
2014-10-20Remove some dead codehallgren
* The following modules are no longer used and have been removed completely: GF.Compile.Compute.ConcreteLazy GF.Compile.Compute.ConcreteStrict GF.Compile.Refresh * The STM monad has been commented out. It was only used in GF.Compile.SubExpOpt, where could be replaced with a plain State monad, since no error handling was needed. One of the functions was hardwired to the Err monad, but did in fact not use error handling, so it was turned into a pure function. * The function errVal has been renamed to fromErr (since it is analogous to fromMaybe). * Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places. * Some additional old code that was already commented out has been removed.
2014-10-16Some work on the haddock documentationhallgren
2014-10-15Fixes for the haddock documentationhallgren
2014-10-09Prelude.CAPIT is now a built-in primitive. It still generates &| in the ↵kr.angelov
Haskell runtime but will be intepreted in the C runtime
2014-07-28Convert from Text.PrettyPrint to GF.Text.Prettyhallgren
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
2014-07-27Introducing GF.Text.Pretty for more concise pretty printers and ↵hallgren
GF.Infra.Location for modularity GF.Text.Pretty provides the class Pretty and overloaded versions of the pretty printing combinators in Text.PrettyPrint, allowing pretty printable values to be used directly instead of first having to convert them to Doc with functions like text, int, char and ppIdent. Some modules have been converted to use GF.Text.Pretty, but not all. Precedences could be added to simplify the pretty printers for terms and patterns. GF.Infra.Location contains the types Location and L, factored out from GF.Grammar.Grammar, and the class HasSourcePath. This allowed the import of GF.Grammar.Grammar to be removed from GF.Infra.CheckM, making it more like a pure library module.
2014-06-17Compute/ConcreteNew.hs: eliminate selections from wildcard tableshallgren
This patch also includes some commented out code that was used to search for the source of code size explosions and an eta expansion bug.
2014-06-12PGF library: expose only PGF and PGF.Internal instead of all moduleshallgren
PGF exports the public, stable API. PGF.Internal exports additional things needed in the GF compiler & shell, including the nonstardard version of Data.Binary.
2014-05-16Compute/ConcreteNew.hs: adding a Prawitz rewritehallgren
(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x This was used in the old partial evaluator and can significantly reduce term sizes in some cases.
2014-03-17show the value in the error message when failing to get Str from valueaarne
2014-02-17fix in GF.Compile.Compute.ConcreteNew which makes it possible to compile ↵kr.angelov
DocumentationBul.gf
2013-11-29Commment code and options relating to the old partial evaluatorhallgren
This means that the -old-comp and -new-comp flags are not recognized anymore. The only functional difference is that printnames were still normalized with the old partial evaluator. Now that is done with the new partial evaluator.
2013-11-29Move typePredefined from GF.Compile.Compute.AppPredefined to ↵hallgren
GF.Compile.TypeCheck.Primitives Also move the list of primitives
2013-11-29Move checkPredefError from GF.Compile.Compute.ConcreteLazy to GF.Grammar.Macroshallgren
Also simplified its type.
2013-11-12added Predef.SOFT_BIND. This special token allows zero or more spaces ↵kr.angelov
between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word.
2013-11-05Eliminate mutual dependencies between the GF compiler and the PGF libraryhallgren
+ References to modules under src/compiler have been eliminated from the PGF library (under src/runtime/haskell). Only two functions had to be moved (from GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent dependencies turned out to be vacuous. + In gf.cabal, the GF executable no longer directly depends on the PGF library source directory, but only on the exposed library modules. This means that there is less duplication in gf.cabal and that the 30 modules in the PGF library will no longer be compiled twice while building GF. To make this possible, additional PGF library modules have been exposed, even though they should probably be considered for internal use only. They could be collected in a PGF.Internal module, or marked as "unstable", to make this explicit. + Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were found and removed, reducing the total number of imports by ~15%.
2013-09-27a major refactoring in the C and the Haskell runtimes. Note incompatible ↵kr.angelov
change in the PGF format!!! The following are the outcomes: - Predef.nonExist is fully supported by both the Haskell and the C runtimes - Predef.BIND is now an internal compiler defined token. For now it behaves just as usual for the Haskell runtime, i.e. it generates &+. However, the special treatment will let us to handle it properly in the C runtime. - This required a major change in the PGF format since both nonExist and BIND may appear inside 'pre' and this was not supported before.
2013-09-19Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 moduleshallgren
Most of the explicit uses of ByteStrings were eliminated by using identS, identS = identC . BS.pack which was found in GF.Grammar.CF and moved to GF.Infra.Ident. The function prefixIdent :: String -> Ident -> Ident allowed one additional import of ByteString to be eliminated. The functions isArgIdent :: Ident -> Bool getArgIndex :: Ident -> Maybe Int were needed to eliminate explicit pattern matching on Ident from two modules.
2013-09-09partial evaluator: prettier complaint about nonlinears patternshallgren
2013-09-09partial evaluator: complain about nonlinear patternshallgren
2013-09-09Fix an old name shadowing bug in concrete syntax by removing the refresh passhallgren
The refresh pass does not correctly keep track of the scope of local variables and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately, it appears that the refresh pass is not needed anymore, so it has been removed.
2013-08-23nonExist now does the expected thingkr.angelov
2013-03-16Fix a problem with pattern macros in pre { } expressionshallgren
The old partial evaluator has special rules to convert pattern macros in pre { } expressions. These rules were missing in the new partial evaluator.
2013-03-12partial evaluator: push predefined functions inside variantshallgren
This should prevent errors like Internal error in Compute.ConcreteNew: Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
2013-02-27Faster regular expression pattern matching in the grammar compiler.hallgren
The sequence operator (x+y) was implemented by splitting the string to be matched at all positions and trying to match the parts against the two subpatterns. To reduce the number of splits, we now estimate the minimum and maximum length of the string that the subpatterns could match. For common cases, where one of the subpatterns is a string of known length, like in (x+"y") or (x + ("a"|"o"|"u"|"e")+"y"), only one split will be tried.
2013-01-29Better error message for unsupported token gluinghallgren
Instead of "Internal error in ...", you now get a proper error message with a source location and a function name.
2013-01-28Better error message for Predef.errorhallgren
+ Instead of "Internal error in ...", you now get a proper error message with a source location and a function name. + Also added some missing error value propagation in the partial evaluator. + Also some other minor cleanup and error handling fixes.
2013-01-11partial evaluator: fix token glueing bughallgren
"a"+("b"++"c") was simplified to "bb"++"c" instead of "ab"++c.
2012-12-19partial evaluator bug fixhallgren
It failed to delay table selection when the selector contains a run-time variable, causing "gf: Prelude.(!!): index too large" instead. Also: + Show better source locations on unexpected errors, to aid bug hunting. + Removed unused SourceGrammar argument to value2term.
2012-12-19GF.Grammar.Lookup: new function lookupResDefLochallgren
It's like lookupResDef but it includes a source location in the output.