summaryrefslogtreecommitdiff
path: root/src/GF/UseGrammar/Editing.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-03-02 08:43:52 +0000
committeraarne <unknown>2005-03-02 08:43:52 +0000
commitd1a21f95620423997279f4fc7f981d919e33e40b (patch)
treea9dba4adc986091c3af2b3c38859314ae02ca406 /src/GF/UseGrammar/Editing.hs
parent0bd427b5a83a97adca52c37219c7bfb8f8ca7e87 (diff)
bug fixes in generate and type check
Diffstat (limited to 'src/GF/UseGrammar/Editing.hs')
-rw-r--r--src/GF/UseGrammar/Editing.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/GF/UseGrammar/Editing.hs b/src/GF/UseGrammar/Editing.hs
index 3e6ed0018..b9ccb6691 100644
--- a/src/GF/UseGrammar/Editing.hs
+++ b/src/GF/UseGrammar/Editing.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/02/24 11:46:38 $
--- > CVS $Author: peb $
--- > CVS $Revision: 1.11 $
+-- > CVS $Date: 2005/03/02 09:43:52 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.12 $
--
-- generic tree editing, with some grammar notions assumed. AR 18\/8\/2001.
-- 19\/6\/2003 for GFC
@@ -358,6 +358,14 @@ peelFunHead gr (f@(m,c),i) state = do
reCheckState :: CGrammar -> State -> Err State
reCheckState gr st = annotate gr (tree2exp (loc2tree st)) >>= return . tree2loc
+-- | a variant that returns Bad instead of a tree with unsolvable constraints
+reCheckStateReject :: CGrammar -> State -> Err State
+reCheckStateReject gr st = do
+ st' <- reCheckState gr st
+ case (constrsNode $ nodeTree $ actTree st') of
+ [] -> return st'
+ cs -> Bad $ "Unsolvable constraints:" +++ prConstraints cs
+
-- | extract metasubstitutions from constraints and solve them
solveAll :: CGrammar -> State -> Err State
solveAll gr st = solve st >>= solve where