summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-10-14 14:34:08 +0000
committeraarne <aarne@cs.chalmers.se>2008-10-14 14:34:08 +0000
commite4dc63f6657153da1a8c906f669581905f054e4a (patch)
treeafc76783d1b890e7420cc3eabc15d882fedcb299 /src/GF
parentec2d7e2299cb7d1d9c786d7d8afdbcc8a526e50d (diff)
rudimentary abstract syntax type checker and solver in PGF
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Command/TreeOperations.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/GF/Command/TreeOperations.hs b/src/GF/Command/TreeOperations.hs
index d4b5d175a..a2670dc4f 100644
--- a/src/GF/Command/TreeOperations.hs
+++ b/src/GF/Command/TreeOperations.hs
@@ -1,11 +1,10 @@
module GF.Command.TreeOperations (
treeOp,
allTreeOps
- --typeCheck,
) where
import GF.Compile.TypeCheck
-import PGF (compute,paraphrase)
+import PGF (compute,paraphrase,typecheck)
-- for conversions
import PGF.Data
@@ -29,12 +28,9 @@ allTreeOps pgf = [
("smallest",("sort trees from smallest to largest, in number of nodes",
smallest)),
("typecheck",("type check and solve metavariables; reject if incorrect",
- id))
+ concatMap (typecheck pgf)))
]
-typeCheck :: PGF -> Tree -> (Tree,(Bool,[String]))
-typeCheck pgf t = (t,(True,[]))
-
smallest :: [Tree] -> [Tree]
smallest = sortBy (\t u -> compare (size t) (size u)) where
size t = case t of