summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Macros.hs
AgeCommit message (Collapse)Author
2021-06-30Sort record fields in lin definitionsJohn J. Camilleri
Fixes #102
2020-09-05MonadFail: Make backwards-compatibleAndreas Källberg
2020-08-05Fix most build errorsAndreas Källberg
2019-09-20more dead codekrangelov
2019-09-20remove obsolete codekrangelov
2015-08-31GF.Infra.SIO: The SIO monad now supports putStr in addition to putStrLnhallgren
Also included some unrelated minor changes.
2015-03-05remove some more old codekrasimir
2014-12-11GF.Grammar.Macros: generalize the type of collectOphallgren
New type: collectOp :: Monoid m => (Term -> m) -> Term -> m
2014-10-22Various small changes for improved documentationhallgren
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-16More haddock documentation improvementshallgren
2014-09-17appForm now skips over Typed expressionskr.angelov
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.
2013-11-29Move checkPredefError from GF.Compile.Compute.ConcreteLazy to GF.Grammar.Macroshallgren
Also simplified its type.
2013-11-20Reduced clutter in monadic codehallgren
+ Eliminated vairous ad-hoc coersion functions between specific monads (IO, Err, IOE, Check) in favor of more general lifting functions (liftIO, liftErr). + Generalized many basic monadic operations from specific monads to arbitrary monads in the appropriate class (MonadIO and/or ErrorMonad), thereby completely eliminating the need for lifting functions in lots of places. This can be considered a small step forward towards a cleaner compiler API and more malleable compiler code in general.
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-10-30added the linref construction in GF. The PGF version number is now bumpedkr.angelov
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.
2012-10-25GF.Grammar.Macros: add function collectPattOphallgren
collectPattOp :: (Patt -> [a]) -> Patt -> [a]
2012-10-24GF.Grammar.Macros: add function composPattOphallgren
For Patt, analogous to composOp for Term.
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.
2011-11-10Now PMCFG is compiled per module and at the end we only link it. The new ↵kr.angelov
compilation schema is few times faster.
2011-11-02merge GF.Infra.Modules and GF.Grammar.Grammar. This is a preparation for the ↵kr.angelov
separate PGF building
2011-11-02Now the compiler maintains more precise information for the source locations ↵kr.angelov
of the different definitions. There is a --tags option which generates a list of all identifiers with their source locations.
2011-10-20Some experiments with PSeq (left commented out)hallgren
2011-09-07GF.Grammar.Macros: simplify composOp and composSafeOphallgren
2011-09-01GF.Grammar.*: generalized the type of some functions that can not fail from ↵hallgren
the Err monad to arbitrary monads
2011-03-03overloaded opers included in sorting of judgementsaarne
2011-02-28the command show_operations to inspect opers in scopeaarne
2010-11-12operations in the abstract syntaxkrasimir
2010-06-18Yay!! Direct generation of PMCFG from GF grammarkrasimir
2010-05-28refactoring in GF.Grammar.Grammarkrasimir
2010-05-28composOp should iterate under ImplArgkrasimir
2010-03-22store and propagate the exact source location for all judgements in the ↵krasimir
grammar. It may not be used accurately in the error messages yet
2010-02-16no need to keep the list of constructors per category in .gfokrasimir
2009-12-13reorganize the directories under src, and rescue the JavaScript interpreter ↵krasimir
from deprecated