summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Printer.hs
AgeCommit message (Collapse)Author
2021-07-07Replace tabs for whitespace in source codeJohn J. Camilleri
2019-03-26bugfix in the pretty printerkrangelov
2018-04-18Fixes for GHC 8.4.1 compatibilityThomas Hallgren
* In GHC 8.4.1, the operator <> has become a method of the Semigroup class and is exported from the Prelude. This is unfortunate, since <> is also exported from the standard library module Text.PrettyPrint, so in any module that defines a pretty printer, there is likely to be an ambiguity. This affects ~18 modules in GF. Solution: import Prelude hiding (<>) This works also in older versions of GHC, since GHC does't complain if you hide something that doesn't exists. * In GHC 8.4.1, Semigroup has become a superclass of Monoid. This means that anywhere you define an instance of the Monoid class you also have to define an instance in the Semigroup class. This affects Data.Binary.Builder in GF. Solution: conditionally define a Semigroup instance if compiling with base>=4.11 (ghc>=8.4.1)
2017-03-07GF.Grammar.Printer now has a Terse mode which prints record types with lock ↵krasimir
fields with their corresponding abstract categories
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-10-21Renaming SourceGrammar to Grammar and similarly for some related typeshallgren
Included renamings: SourceGrammar -> Grammar SourceModule -> Module SourceModInfo -> ModuleInfo emptySourceGrammar -> emptyGrammar Also introduces a type synonym (which might be good to turn into a newtype): type ModuleName = Ident The reason is to make types like the following more self documenting: type Module = (ModuleName,ModuleInfo) type QIdent = (ModuleName,Ident)
2014-10-16More haddock documentation improvementshallgren
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-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-02-01new overload resolution, taking care of ad hoc overloading.aarne
2013-11-06the content of ParseEngAbs3.probs is now merged with ParseEngAbs.probs. The ↵kr.angelov
later is now retrained. Once the grammar is compiled with the .probs file now it doesn't need anything more to do robust parsing. The robustness itself is controlled by the flags 'heuristic_search_factor', 'meta_prob' and 'meta_token_prob' in ParseEngAbs.gf
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.
2013-02-27GF grammar pretty printer improvementshallgren
Allow line breaks in more places to make large terms more readable.
2012-11-23Fix a prededence bug in GF grammar pretty printerhallgren
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...)
2012-06-25printing ResValue judgements as comments, to provide useful information when ↵aarne
a conflict is found between parameter constructors
2012-02-22gfse: experimental support for editing concrete syntax in text modehallgren
2011-11-29Sketch of the new type checker for the concrete syntax. Enabled only with ↵kr.angelov
-new-comp
2011-11-15now the pretty printer in GF has a new mode called Internal. This is the ↵kr.angelov
most detailed mode and it can print even things that are not in the GF syntax. For example PMCFG snippets and indirections.
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-20Introduce an explicit error value in the Term typehallgren
This makes it easier to treat run-time errors (e.g. caused by calls to Predef.error) in a way that is more typical for a lazy functional language.
2011-09-22change the precedence for the left argument of ->kr.angelov
2011-09-20module for analysing source grammarsaarne
2011-09-20command ss to show source (including gfo) in text; to be extendedaarne
2011-03-12make it possible to override opers defined in an interface by syntax ↵aarne
'instance Foo of Bar - [f,g,h]'
2010-11-12operations in the abstract syntaxkrasimir
2010-06-21GF.Grammar.Printer: print expressions with lincat and linkrasimir
2010-06-18Yay!! Direct generation of PMCFG from GF grammarkrasimir
2010-06-08revert change in GF.Grammar.Printer that was intended for debugging onlykrasimir
2010-05-28refactoring in GF.Grammar.Grammarkrasimir
2010-05-28bugfix in GF.Grammar.Printerkrasimir
2010-03-31fixed a deep bug in TypeCheck due to swap of arguments; print empty record ↵aarne
as <> instead of {} to distinguish from empty record type
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-03-18fix the precedence for patterns ~, - and @krasimir
2010-03-18syntax for inaccessible patterns in GFkrasimir
2010-02-22rule for pretty printing implicit argumentskrasimir
2010-02-22add pretty printing rule for implicit patternskrasimir
2010-02-16no need to keep the list of constructors per category in .gfokrasimir
2010-02-03fix the tabular printing when there is a V constructorkrasimir
2010-01-31refactor GF.Infra.Modules for better error messageskrasimir
2009-12-13reorganize the directories under src, and rescue the JavaScript interpreter ↵krasimir
from deprecated