1
0
forked from GitHub/gf-core

restored work on Extend and Rename

This commit is contained in:
aarne
2007-12-06 12:54:15 +00:00
parent 7d1b964a78
commit f08eb82f2b
11 changed files with 1567 additions and 65 deletions

View File

@@ -3,6 +3,7 @@ module GF.Devel.Grammar.MkJudgements where
import GF.Devel.Grammar.Macros
import GF.Devel.Grammar.Judgements
import GF.Devel.Grammar.Terms
import GF.Devel.Grammar.PrGF
import GF.Infra.Ident
import GF.Data.Operations
@@ -10,6 +11,8 @@ import GF.Data.Operations
import Control.Monad
import Data.Map
import Debug.Trace (trace) ----
-- constructing judgements from parse tree
emptyJudgement :: JudgementForm -> Judgement
@@ -79,5 +82,12 @@ unifyJudgement old new = do
unifyTerm oterm nterm = case (oterm,nterm) of
(Meta _,t) -> return t
(t,Meta _) -> return t
_ -> testErr (nterm == oterm) "incompatible fields" >> return nterm
_ -> do
if (nterm /= oterm)
then (trace (unwords ["illegal update of",prt oterm,"to",prt nterm])
(return ()))
else return () ---- to recover from spurious qualification conflicts
---- testErr (nterm == oterm)
---- (unwords ["illegal update of",prt oterm,"to",prt nterm])
return nterm