summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authoraarne <unknown>2003-09-24 14:26:35 +0000
committeraarne <unknown>2003-09-24 14:26:35 +0000
commit6e9258558a9bcb8c9df4bee0382b5136c95f516a (patch)
tree99475ee58ba264780403480ce29c9ee40beee1ec /src/GF/Compile
parentb1402e8bd6a68a891b00a214d6cf184d66defe19 (diff)
Improvements in hte editor.
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/PGrammar.hs2
-rw-r--r--src/GF/Compile/ShellState.hs19
2 files changed, 13 insertions, 8 deletions
diff --git a/src/GF/Compile/PGrammar.hs b/src/GF/Compile/PGrammar.hs
index 06d9fc72e..6237b6f25 100644
--- a/src/GF/Compile/PGrammar.hs
+++ b/src/GF/Compile/PGrammar.hs
@@ -43,12 +43,14 @@ string2formsAndTerm s = case s of
(x,_:y) -> (pTrms (tail x), pTrm y)
_ -> ([],pTrm s)
_ -> ([], pTrm s)
+-}
string2ident :: String -> Err Ident
string2ident s = return $ case s of
c:'_':i -> identV (readIntArg i,[c]) ---
_ -> zIdent s
+{-
-- reads the Haskell datatype
readGrammar :: String -> Err GrammarST
readGrammar s = case [x | (x,t) <- reads s, ("","") <- lex t] of
diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs
index f24c3b87c..661e1bedd 100644
--- a/src/GF/Compile/ShellState.hs
+++ b/src/GF/Compile/ShellState.hs
@@ -3,8 +3,11 @@ module ShellState where
import Operations
import GFC
import AbsGFC
----import CMacros
+import Macros
+import MMacros
+
import Look
+import LookAbs
import qualified Modules as M
import qualified Grammar as G
import qualified PrGrammar as P
@@ -108,15 +111,12 @@ updateShellState opts sh (gr,(sgr,rts)) = do
notInrts f = notElem f $ map fst rts
cfs <- mapM (canon2cf opts cgr) concrs --- would not need to update all...
- let funs = [] ---- funRulesOf cgr
- let cats = [] ---- allCatsOf cgr
- let csi = [] ----
-{-
- [(c,(co,
+ let funs = funRulesOf cgr
+ let cats = allCatsOf cgr
+ let csi = [(c,(co,
[(fun,typ) | (fun,typ) <- funs, compatType tc typ],
funsOnTypeFs compatType funs tc))
- | (c,co) <- cats, let tc = cat2type c]
--}
+ | (c,co) <- cats, let tc = cat2val co c]
let deps = True ---- not $ null $ allDepCats cgr
let binds = [] ---- allCatsWithBind cgr
@@ -163,6 +163,9 @@ greatestAbstract gr = case allAbstracts gr of
[] -> Nothing
a -> return $ last a
+qualifTop :: StateGrammar -> G.QIdent -> G.QIdent
+qualifTop gr (_,c) = (absId gr,c)
+
-- all concretes for a given abstract
allConcretes :: CanonGrammar -> Ident -> [Ident]
allConcretes gr a = [i | (i,M.ModMod m) <- M.modules gr, M.mtype m== M.MTConcrete a]