summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-03-05 18:59:14 +0000
committeraarne <aarne@cs.chalmers.se>2008-03-05 18:59:14 +0000
commitfe863958533cd905939241e6fa50af439058cf5a (patch)
treec8254e5797d795d733585d0d82e85d4d4a1fa9dd
parent674b4765e653d91c8c900da1263df8c0f4d767ad (diff)
debugging testgf3
-rw-r--r--examples/features/Param.gf5
-rw-r--r--src/GF/Devel/Compile/CheckGrammar.hs3
-rw-r--r--src/GF/Devel/Compile/Compile.hs9
-rw-r--r--src/GF/Devel/Grammar/Lookup.hs2
-rw-r--r--src/GF/Devel/README-testgf312
5 files changed, 20 insertions, 11 deletions
diff --git a/examples/features/Param.gf b/examples/features/Param.gf
index 0b5ed2453..15b0cd8b7 100644
--- a/examples/features/Param.gf
+++ b/examples/features/Param.gf
@@ -2,9 +2,10 @@ resource Param = {
param Bool = True | False ;
- oper and : Bool -> Bool -> Bool = \x,y -> case x of {
+ oper and -- : Bool -> Bool -> Bool
+ = \\x,y => case x of {
True => y ;
- _ => False
+ False => False
} ;
}
diff --git a/src/GF/Devel/Compile/CheckGrammar.hs b/src/GF/Devel/Compile/CheckGrammar.hs
index 1baab392f..e9daa1f64 100644
--- a/src/GF/Devel/Compile/CheckGrammar.hs
+++ b/src/GF/Devel/Compile/CheckGrammar.hs
@@ -203,8 +203,10 @@ checkCompleteGrammar abs cnc = do
checkResInfo :: GF -> Ident -> Ident -> Judgement -> Check Judgement
checkResInfo gr mo c info = do
---- checkReservedId c
+ trace (show info) (return ())
case jform info of
JOper -> chIn "operation" $ case (jtype info, jdef info) of
+ _ | isConstructor info -> return info
(_,Meta _) -> do
checkWarn "No definition given to oper"
return info
@@ -698,6 +700,7 @@ getOverload env@gr mt t = case appForm t of
checkLType :: GF -> Term -> Type -> Check (Term, Type)
checkLType env trm typ0 = do
+ trace (show trm) (return ())
typ <- comp typ0
diff --git a/src/GF/Devel/Compile/Compile.hs b/src/GF/Devel/Compile/Compile.hs
index b636f0fa7..e0de193c1 100644
--- a/src/GF/Devel/Compile/Compile.hs
+++ b/src/GF/Devel/Compile/Compile.hs
@@ -34,9 +34,12 @@ batchCompile opts files = do
-- to output an intermediate stage
intermOut :: Options -> Option -> String -> IOE ()
-intermOut opts opt s = if oElem opt opts then
- ioeIO (putStrLn ("\n\n--#" +++ prOpt opt) >> putStrLn s)
- else return ()
+intermOut opts opt s =
+ if oElem opt opts || oElem (iOpt "show_all") opts
+ then
+ ioeIO (putStrLn ("\n\n--#" +++ prOpt opt) >> putStrLn s)
+ else
+ return ()
prMod :: SourceModule -> String
prMod = prModule
diff --git a/src/GF/Devel/Grammar/Lookup.hs b/src/GF/Devel/Grammar/Lookup.hs
index 0a8452dcb..689996760 100644
--- a/src/GF/Devel/Grammar/Lookup.hs
+++ b/src/GF/Devel/Grammar/Lookup.hs
@@ -44,7 +44,7 @@ lookupOperType gr m c = do
case jform ju of
JParam -> return typePType
_ -> case jtype ju of
- Meta _ -> fail ("no type given to " ++ prIdent m ++ "." ++ prIdent c ++ " in " ++ show ju)
+ Meta _ -> fail ("no type given to " ++ prIdent m ++ "." ++ prIdent c)
ty -> return ty
---- can't be just lookupJField jtype
diff --git a/src/GF/Devel/README-testgf3 b/src/GF/Devel/README-testgf3
index f7ea4b6aa..15f1be449 100644
--- a/src/GF/Devel/README-testgf3
+++ b/src/GF/Devel/README-testgf3
@@ -26,9 +26,11 @@ More options (debugging flags):
-show_refreshing -- ... after refreshing variables
-show_optimize -- ... after partial evaluation
-show_factorize -- ... after factoring optimization
+ -show_all -- show all phases
+
+ -1 -- stop after parsing
+ -2 -- ... extending
+ -3 -- ... renaming
+ -4 -- ... type checking
+ -5 -- ... refreshing
- -1 -- stop before extending
- -2 -- ... renaming
- -3 -- ... type checking
- -4 -- ... refreshing
- -5 -- ... partial evaluation