1
0
forked from GitHub/gf-core
Commit Graph

19 Commits

Author SHA1 Message Date
hallgren
7a91afc02a Convert from Text.PrettyPrint to GF.Text.Pretty
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
2014-07-28 11:58:00 +00:00
hallgren
7d1c011389 Commment code and options relating to the old partial evaluator
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-29 16:26:49 +00:00
hallgren
7ffdfe9b3a Move typePredefined from GF.Compile.Compute.AppPredefined to GF.Compile.TypeCheck.Primitives
Also move the list of primitives
2013-11-29 15:47:26 +00:00
kr.angelov
0095119ec0 added Predef.SOFT_BIND. This special token allows zero or more spaces between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word. 2013-11-12 09:54:57 +00:00
hallgren
3814841d7d Eliminate mutual dependencies between the GF compiler and the PGF library
+ 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-11-05 13:11:10 +00:00
kr.angelov
426bc49a52 a major refactoring in the C and the Haskell runtimes. Note incompatible 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-27 15:09:48 +00:00
hallgren
3d5b9bd1fd Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 modules
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-19 18:23:47 +00:00
kr.angelov
a20cd77d25 nonExist now does the expected thing 2013-08-23 13:17:45 +00:00
hallgren
b4207d1b00 GF.Grammar.Lookup: new function lookupResDefLoc
It's like lookupResDef but it includes a source location in the output.
2012-12-19 23:08:56 +00:00
aarne
69f84defb0 bug fix in AppPredefined: don't compare values that contain variables. this should be checked even more generally. 2012-02-28 15:13:32 +00:00
aarne
aa7668ef75 the Predef function eqVal to compare equality of parameter values 2012-02-24 10:00:27 +00:00
kr.angelov
416d231c5e Now PMCFG is compiled per module and at the end we only link it. The new compilation schema is few times faster. 2011-11-10 14:09:41 +00:00
kr.angelov
734c66710e merge GF.Infra.Modules and GF.Grammar.Grammar. This is a preparation for the separate PGF building 2011-11-02 13:57:11 +00:00
kr.angelov
5fe49ed9f7 Now the compiler maintains more precise information for the source locations of the different definitions. There is a --tags option which generates a list of all identifiers with their source locations. 2011-11-02 11:44:59 +00:00
hallgren
ed451653bd Introduce an explicit error value in the Term type
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-10-20 14:36:30 +00:00
hallgren
d8d60adb15 AppPredefined.hs: more readable notation for the types of primitives 2011-10-20 14:17:37 +00:00
aarne
a3924abece Predef functions toUpper, toLower, isUpper 2011-06-02 16:10:46 +00:00
krasimir
710b8f1bf7 the abstract syntax for Predef.gf is now hard-coded in AppPredefined.hs 2010-07-01 15:38:16 +00:00
krasimir
e0231cbf5b reorganize the modules in GF.Compile.* 2010-07-01 14:19:32 +00:00