diff options
Diffstat (limited to 'src/GF/Devel/Grammar')
| -rw-r--r-- | src/GF/Devel/Grammar/Compute.hs | 2 | ||||
| -rw-r--r-- | src/GF/Devel/Grammar/Construct.hs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/GF/Devel/Grammar/Compute.hs b/src/GF/Devel/Grammar/Compute.hs index 449cd3b90..6835fdbe1 100644 --- a/src/GF/Devel/Grammar/Compute.hs +++ b/src/GF/Devel/Grammar/Compute.hs @@ -63,7 +63,7 @@ computeTermOpt rec gr = comp where ---- Computed t' -> return $ unComputed t' Vr x -> do - t' <- maybe (prtBad ("no value given to variable") x) return $ lookup x g + t' <- maybe (prtBad ("no value for variable") x) return $ lookup x g case t' of _ | t == t' -> return t _ -> comp g t' diff --git a/src/GF/Devel/Grammar/Construct.hs b/src/GF/Devel/Grammar/Construct.hs index bc966fcf6..6d77c1c31 100644 --- a/src/GF/Devel/Grammar/Construct.hs +++ b/src/GF/Devel/Grammar/Construct.hs @@ -149,7 +149,11 @@ unifyJudgement old new = do ---- (unwords ["illegal update of",prt oterm,"to",prt nterm]) return nterm - +updateJudgement :: Ident -> Ident -> Judgement -> GF -> Err GF +updateJudgement m c ju gf = do + mo <- maybe (Bad (show m)) return $ Data.Map.lookup m $ gfmodules gf + let mo' = mo {mjments = insert c ju (mjments mo)} + return $ gf {gfmodules = insert m mo' (gfmodules gf)} -- abstractions on Term |
