mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
Make PGF.Tree internal
The only use of PGF.Tree outside the PGF library was in GF.Command.Commands, and it was eliminated by using PGF.Expr directly instead. PGF.Paraphrase still uses PGF.Tree.
This commit is contained in:
2
gf.cabal
2
gf.cabal
@@ -89,7 +89,6 @@ Library
|
|||||||
PGF.Macros
|
PGF.Macros
|
||||||
PGF.Optimize
|
PGF.Optimize
|
||||||
PGF.Printer
|
PGF.Printer
|
||||||
PGF.Tree
|
|
||||||
PGF.Utilities
|
PGF.Utilities
|
||||||
other-modules:
|
other-modules:
|
||||||
PGF.CId
|
PGF.CId
|
||||||
@@ -102,6 +101,7 @@ Library
|
|||||||
PGF.Parse
|
PGF.Parse
|
||||||
PGF.Probabilistic
|
PGF.Probabilistic
|
||||||
PGF.SortTop
|
PGF.SortTop
|
||||||
|
PGF.Tree
|
||||||
PGF.Type
|
PGF.Type
|
||||||
PGF.Tokenizer
|
PGF.Tokenizer
|
||||||
PGF.TypeCheck
|
PGF.TypeCheck
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import PGF.Data(abstract,funs,cats,Literal(LStr),Expr(EFun,ELit)) ----
|
|||||||
import PGF.Printer(ppFun,ppCat)
|
import PGF.Printer(ppFun,ppCat)
|
||||||
--import PGF.Probabilistic(rankTreesByProbs,probTree,setProbabilities)
|
--import PGF.Probabilistic(rankTreesByProbs,probTree,setProbabilities)
|
||||||
--import PGF.Generate (generateRandomFrom) ----
|
--import PGF.Generate (generateRandomFrom) ----
|
||||||
import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
|
--import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
|
||||||
import PGF.Optimize(optimizePGF)
|
import PGF.Optimize(optimizePGF)
|
||||||
|
|
||||||
import GF.Compile.Export
|
import GF.Compile.Export
|
||||||
@@ -1198,10 +1198,9 @@ allCommands = Map.fromList [
|
|||||||
_ -> unl . linearize pgf lang
|
_ -> unl . linearize pgf lang
|
||||||
|
|
||||||
-- replace each non-atomic constructor with mkC, where C is the val cat
|
-- replace each non-atomic constructor with mkC, where C is the val cat
|
||||||
tree2mk pgf = showExpr [] . tree2expr . t2m . expr2tree where
|
tree2mk pgf = showExpr [] . t2m where
|
||||||
t2m t = case t of
|
t2m t = case unApp t of
|
||||||
Fun cid [] -> t
|
Just (cid,ts@(_:_)) -> mkApp (mk cid) (map t2m ts)
|
||||||
Fun cid ts -> Fun (mk cid) (map t2m ts)
|
|
||||||
_ -> t
|
_ -> t
|
||||||
mk = mkCId . ("mk" ++) . showCId . lookValCat (abstract pgf)
|
mk = mkCId . ("mk" ++) . showCId . lookValCat (abstract pgf)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user