Merge branch 'master' into lpgf

# Conflicts:
#	gf.cabal
#	src/compiler/GF/Grammar/Canonical.hs
This commit is contained in:
John J. Camilleri
2021-07-07 09:42:44 +02:00
33 changed files with 867 additions and 834 deletions

View File

@@ -43,8 +43,8 @@ custom-setup
setup-depends:
base,
Cabal >=1.22.0.0,
directory,
filepath,
directory >= 1.3.0 && < 1.4,
filepath >= 1.4.1 && < 1.5,
process >=1.0.1.1
source-repository head
@@ -75,7 +75,7 @@ library
default-language: Haskell2010
build-depends:
-- GHC 8.0.2 to GHC 8.10.4
base >= 4.9.1 && <4.15,
base >= 4.9.1 && < 4.15,
array >= 0.5.1 && < 0.6,
containers >= 0.5.7 && < 0.7,
bytestring >= 0.10.8 && < 0.11,
@@ -138,8 +138,12 @@ library
if flag(c-runtime)
exposed-modules: PGF2
other-modules: PGF2.FFI PGF2.Expr PGF2.Type
GF.Interactive2 GF.Command.Commands2
other-modules:
PGF2.FFI
PGF2.Expr
PGF2.Type
GF.Interactive2
GF.Command.Commands2
hs-source-dirs: src/runtime/haskell-bind
build-tools: hsc2hs
extra-libraries: pgf gu
@@ -166,12 +170,19 @@ library
GF.Grammar.Canonical
other-modules:
GF.Main GF.Compiler GF.Interactive
GF.Main
GF.Compiler
GF.Interactive
GF.Compile GF.CompileInParallel GF.CompileOne GF.Compile.GetGrammar
GF.Compile
GF.CompileInParallel
GF.CompileOne
GF.Compile.GetGrammar
GF.Grammar
GF.Data.Operations GF.Infra.Option GF.Infra.UseIO
GF.Data.Operations
GF.Infra.Option
GF.Infra.UseIO
GF.Command.Abstract
GF.Command.CommandInfo
@@ -283,12 +294,17 @@ library
cpp-options: -DC_RUNTIME
if flag(server)
build-depends: httpd-shed >= 0.4.0 && < 0.5, network>=2.3 && <2.7,
build-depends:
httpd-shed >= 0.4.0 && < 0.5,
network>=2.3 && <2.7,
cgi >= 3001.3.0.2 && < 3001.6
if flag(network-uri)
build-depends: network-uri >= 2.6.1.0 && < 2.7, network>=2.6 && <2.7
build-depends:
network-uri >= 2.6.1.0 && < 2.7,
network>=2.6 && <2.7
else
build-depends: network >= 2.5 && <2.6
build-depends:
network >= 2.5 && <2.6
cpp-options: -DSERVER_MODE
other-modules:
@@ -305,7 +321,10 @@ library
Fold
ExampleDemo
ExampleService
hs-source-dirs: src/server src/server/transfer src/example-based
hs-source-dirs:
src/server
src/server/transfer
src/example-based
if flag(interrupt)
cpp-options: -DUSE_INTERRUPT
@@ -314,17 +333,24 @@ library
other-modules: GF.System.NoSignal
if impl(ghc>=7.8)
build-tools: happy>=1.19, alex>=3.1
build-tools:
happy>=1.19,
alex>=3.1
-- ghc-options: +RTS -A20M -RTS
else
build-tools: happy, alex>=3
build-tools:
happy,
alex>=3
ghc-options: -fno-warn-tabs
if os(windows)
build-depends: Win32 >= 2.3.1.1 && < 2.7
build-depends:
Win32 >= 2.3.1.1 && < 2.7
else
build-depends: unix >= 2.7.2 && < 2.8, terminfo >=0.4.0 && < 0.5
build-depends:
unix >= 2.7.2 && < 2.8,
terminfo >=0.4.0 && < 0.5
if impl(ghc>=8.2)
ghc-options: -fhide-source-paths
@@ -333,7 +359,9 @@ executable gf
hs-source-dirs: src/programs
main-is: gf-main.hs
default-language: Haskell2010
build-depends: gf, base
build-depends:
gf,
base
ghc-options: -threaded
--ghc-options: -fwarn-unused-imports
@@ -347,21 +375,31 @@ executable gf
if impl(ghc>=8.2)
ghc-options: -fhide-source-paths
executable pgf-shell
--if !flag(c-runtime)
buildable: False
main-is: pgf-shell.hs
hs-source-dirs: src/runtime/haskell-bind/examples
build-depends: gf, base, containers, mtl, lifted-base
default-language: Haskell2010
if impl(ghc>=7.0)
ghc-options: -rtsopts
-- executable pgf-shell
-- --if !flag(c-runtime)
-- buildable: False
-- main-is: pgf-shell.hs
-- hs-source-dirs: src/runtime/haskell-bind/examples
-- build-depends:
-- gf,
-- base,
-- containers,
-- mtl,
-- lifted-base
-- default-language: Haskell2010
-- if impl(ghc>=7.0)
-- ghc-options: -rtsopts
test-suite gf-tests
type: exitcode-stdio-1.0
main-is: run.hs
hs-source-dirs: testsuite
build-depends: base>=4.3 && <5, Cabal>=1.8, directory, filepath, process
build-depends:
base >= 4.9.1 && < 4.15,
Cabal >= 1.8,
directory >= 1.3.0 && < 1.4,
filepath >= 1.4.1 && < 1.5,
process >= 1.4.3 && < 1.7
build-tool-depends: gf:gf
default-language: Haskell2010

View File

@@ -69,7 +69,6 @@ computeLType gr g0 t = comp (reverse [(b,x, Vr x) | (b,x,_) <- g0] ++ g0) t
lockRecType c t' ---- locking to be removed AR 20/6/2009
_ | ty == typeTok -> return typeStr
_ | isPredefConstant ty -> return ty
_ -> composOp (comp g) ty

View File

@@ -12,7 +12,8 @@
-- Thierry Coquand's type checking algorithm that creates a trace
-----------------------------------------------------------------------------
module GF.Compile.TypeCheck.TC (AExp(..),
module GF.Compile.TypeCheck.TC (
AExp(..),
Theory,
checkExp,
inferExp,
@@ -321,4 +322,3 @@ mkAnnot :: (Val -> AExp) -> Err (Val,[(Val,Val)]) -> Err (AExp,Val,[(Val,Val)])
mkAnnot a ti = do
(v,cs) <- ti
return (a v, v, cs)

View File

@@ -34,7 +34,7 @@ buildAnyTree :: Fail.MonadFail m => ModuleName -> [(Ident,Info)] -> m (Map.Map I
buildAnyTree m = go Map.empty
where
go map [] = return map
go map ((c,j):is) = do
go map ((c,j):is) =
case Map.lookup c map of
Just i -> case unifyAnyInfo m i j of
Ok k -> go (Map.insert c k map) is

View File

@@ -266,7 +266,6 @@ instance PPA LinPattern where
RecordPattern r -> block r
TuplePattern ps -> "<"<>punctuate "," ps<>">"
WildPattern -> pp "_"
_ -> parens p
instance RhsSeparator LinPattern where rhsSep _ = pp "="

View File

@@ -12,7 +12,8 @@
-- pattern matching for both concrete and abstract syntax. AR -- 16\/6\/2003
-----------------------------------------------------------------------------
module GF.Grammar.PatternMatch (matchPattern,
module GF.Grammar.PatternMatch (
matchPattern,
testOvershadow,
findMatch,
measurePatt

View File

@@ -362,4 +362,3 @@ getLet :: Term -> ([LocalDef], Term)
getLet (Let l e) = let (ls,e') = getLet e
in (l:ls,e')
getLet e = ([],e)

View File

@@ -12,7 +12,8 @@
-- (Description of the module)
-----------------------------------------------------------------------------
module GF.Grammar.Values (-- ** Values used in TC type checking
module GF.Grammar.Values (
-- ** Values used in TC type checking
Val(..), Env,
-- ** Annotated tree used in editing
Binds, Constraints, MetaSubst,

View File

@@ -110,4 +110,3 @@ prepunctuate p (x:xs) = x : map (p <>) xs
($++$) :: Doc -> Doc -> Doc
x $++$ y = x $$ emptyLine $$ y

View File

@@ -125,4 +125,3 @@ prepunctuate p (x:xs) = x : map (p <>) xs
($++$) :: Doc -> Doc -> Doc
x $++$ y = x $$ emptyLine $$ y

View File

@@ -300,9 +300,7 @@ transAncientGreek = mkTransliteration "ancient Greek" allTrans allCodes where
transAmharic :: Transliteration
transAmharic = mkTransliteration "Amharic" allTrans allCodes where
allTrans = words $
allTrans = words $
" h. h- h' h( h) h h? h* l. l- l' l( l) l l? l* "++
" H. H- H' H( H) H H? H* m. m- m' m( m) m m? m* "++
" s. s- s' s( s) s s? s* r. r- r' r( r) r r? r* "++
@@ -325,7 +323,7 @@ allTrans = words $
" P. P- P' P( P) P P? P* S. S- S' S( S) S S? S* "++
" - - - - - - - - f. f- f' f( f) f f? f*"++
" p. p- p' p( p) p p? p*"
allCodes = [0x1200..0x1357]
allCodes = [0x1200..0x1357]
-- by Prasad 31/5/2013
transSanskrit :: Transliteration

View File

@@ -26,7 +26,7 @@ library
PGF2.Expr,
PGF2.Type
build-depends:
base >= 4.9.1 && <4.15,
base >= 4.9.1 && < 4.15,
containers >= 0.5.7 && < 0.7,
pretty >= 1.1.3 && < 1.2
default-language: Haskell2010

View File

@@ -14,7 +14,7 @@ tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4
library
default-language: Haskell2010
build-depends:
base >= 4.9.1 && <4.15,
base >= 4.9.1 && < 4.15,
array >= 0.5.1 && < 0.6,
containers >= 0.5.7 && < 0.7,
bytestring >= 0.10.8 && < 0.11,