diff options
| author | aarne <unknown> | 2004-11-01 21:41:18 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-11-01 21:41:18 +0000 |
| commit | 2bd22e078aa0205f60bb414d2e7f17d73db1eaea (patch) | |
| tree | 4a070991183a09d21f4a517bf05fd4cfa1610df5 /src/GF/UseGrammar/Editing.hs | |
| parent | 42ff99469a12e54958f07b58b24f69834c9c1569 (diff) | |
some bug fixes in type check and solve
Diffstat (limited to 'src/GF/UseGrammar/Editing.hs')
| -rw-r--r-- | src/GF/UseGrammar/Editing.hs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/GF/UseGrammar/Editing.hs b/src/GF/UseGrammar/Editing.hs index 45e180b0d..12113b91f 100644 --- a/src/GF/UseGrammar/Editing.hs +++ b/src/GF/UseGrammar/Editing.hs @@ -187,10 +187,11 @@ refineWithTreeReal :: Bool -> CGrammar -> Tree -> Meta -> Action refineWithTreeReal der gr tree m state = do state' <- replaceSubTree tree state let cs0 = allConstrs state' - (cs,ms) = splitConstraints cs0 + (cs,ms) = splitConstraints gr cs0 v = vClos $ tree2exp (bodyTree tree) msubst = (m,v) : ms - metaSubstRefinements gr msubst $ mapLoc (performMetaSubstNode msubst) state' + metaSubstRefinements gr msubst $ + mapLoc (reduceConstraintsNode gr . performMetaSubstNode msubst) state' -- without dep. types, no constraints, no grammar needed - simply: do -- testErr (actIsMeta state) "move pointer to meta" @@ -339,12 +340,13 @@ reCheckState gr st = annotate gr (tree2exp (loc2tree st)) >>= return . tree2loc -- extract metasubstitutions from constraints and solve them solveAll :: CGrammar -> State -> Err State -solveAll gr st0 = do - st <- reCheckState gr st0 - let cs0 = allConstrs st - (cs,ms) = splitConstraints cs0 - metaSubstRefinements gr ms $ mapLoc (performMetaSubstNode ms) st - +solveAll gr st = solve st >>= solve where + solve st0 = do ---- why need twice? + st <- reCheckState gr st0 + let cs0 = allConstrs st + (cs,ms) = splitConstraints gr cs0 + metaSubstRefinements gr ms $ + mapLoc (reduceConstraintsNode gr . performMetaSubstNode ms) st -- active refinements |
