summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/PatternMatch.hs
AgeCommit message (Collapse)Author
2021-07-07Replace tabs for whitespace in source codeJohn J. Camilleri
2020-02-18another bug related to mattern matching on multiword expressionkrangelov
2020-02-17fix: pattern matching on strings should reconstruct the tokens after matchingkrangelov
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
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-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-09-05Fix an old bug that prevented pattern matching agains values containg tableshallgren
The function GF.Grammar.PatternMatch.isInConstantForm returned False for all tables, causing matchPattern to fail, claiming that "variables occur in" the term if it contains tables. This problem is several years old, confirmed present in GF 3.2.10 (Oct 2010).
2013-02-28pattern match length estimation code simplicationhallgren
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-11-07GF.Grammar.PatternMatch: relax overly restrictive type signatureshallgren
2011-10-20Some experiments with PSeq (left commented out)hallgren
2011-08-30PatternMatch.hs: commented out suspicious unused function varsOfPatthallgren
2010-05-28refactoring in GF.Grammar.Grammarkrasimir
2009-12-13reorganize the directories under src, and rescue the JavaScript interpreter ↵krasimir
from deprecated