forked from GitHub/gf-core
Restored read term in editor.
This commit is contained in:
@@ -23,11 +23,11 @@ import Arch (ModTime)
|
|||||||
|
|
||||||
-- multilingual state with grammars and options
|
-- multilingual state with grammars and options
|
||||||
data ShellState = ShSt {
|
data ShellState = ShSt {
|
||||||
abstract :: Maybe Ident , -- pointer to actual abstract; nothing in empty st
|
abstract :: Maybe Ident , -- pointer to actual abstract, if not empty st
|
||||||
concrete :: Maybe Ident , -- pointer to primary concrete
|
concrete :: Maybe Ident , -- pointer to primary concrete
|
||||||
concretes :: [(Ident,Ident)], -- list of all concretes
|
concretes :: [(Ident,Ident)], -- list of all concretes
|
||||||
canModules :: CanonGrammar , -- the place where abstracts and concretes reside
|
canModules :: CanonGrammar , -- compiled abstracts and concretes
|
||||||
srcModules :: G.SourceGrammar , -- the place of saved resource modules
|
srcModules :: G.SourceGrammar , -- saved resource modules
|
||||||
cfs :: [(Ident,CF)] , -- context-free grammars
|
cfs :: [(Ident,CF)] , -- context-free grammars
|
||||||
morphos :: [(Ident,Morpho)], -- morphologies
|
morphos :: [(Ident,Morpho)], -- morphologies
|
||||||
gloptions :: Options, -- global options
|
gloptions :: Options, -- global options
|
||||||
@@ -69,6 +69,7 @@ data StateGrammar = StGr {
|
|||||||
cncId :: Ident,
|
cncId :: Ident,
|
||||||
grammar :: CanonGrammar,
|
grammar :: CanonGrammar,
|
||||||
cf :: CF,
|
cf :: CF,
|
||||||
|
---- parser :: StaticParserInfo,
|
||||||
morpho :: Morpho
|
morpho :: Morpho
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +92,8 @@ cncModuleIdST = stateGrammarST
|
|||||||
-- form a shell state from a canonical grammar
|
-- form a shell state from a canonical grammar
|
||||||
|
|
||||||
grammar2shellState :: Options -> (CanonGrammar, G.SourceGrammar) -> Err ShellState
|
grammar2shellState :: Options -> (CanonGrammar, G.SourceGrammar) -> Err ShellState
|
||||||
grammar2shellState opts (gr,sgr) = updateShellState opts emptyShellState (gr,(sgr,[]))
|
grammar2shellState opts (gr,sgr) =
|
||||||
|
updateShellState opts emptyShellState (gr,(sgr,[]))
|
||||||
|
|
||||||
-- update a shell state from a canonical grammar
|
-- update a shell state from a canonical grammar
|
||||||
|
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ possibleConstraint gr (u,v) = errVal True $ do
|
|||||||
v' <- val2exp v >>= compute gr
|
v' <- val2exp v >>= compute gr
|
||||||
return $ cts u' v'
|
return $ cts u' v'
|
||||||
where
|
where
|
||||||
cts t u = case (t,u) of
|
cts t u = isUnknown t || isUnknown u || case (t,u) of
|
||||||
(Q m c, Q n d) -> c == d || notCan (m,c) || notCan (n,d)
|
(Q m c, Q n d) -> c == d || notCan (m,c) || notCan (n,d)
|
||||||
(App f a, App g b) -> cts f g && cts a b
|
(App f a, App g b) -> cts f g && cts a b
|
||||||
(Abs x b, Abs y c) -> cts b c
|
(Abs x b, Abs y c) -> cts b c
|
||||||
(Prod x a f, Prod y b g) -> cts a b && cts f g
|
(Prod x a f, Prod y b g) -> cts a b && cts f g
|
||||||
(_ , _) -> isUnknown t || isUnknown u
|
(_ , _) -> False
|
||||||
|
|
||||||
isUnknown t = case t of
|
isUnknown t = case t of
|
||||||
Vr _ -> True
|
Vr _ -> True
|
||||||
|
|||||||
@@ -222,14 +222,11 @@ execECommand env c = case c of
|
|||||||
|
|
||||||
CAlphaConvert s -> action2commandNext $ \x ->
|
CAlphaConvert s -> action2commandNext $ \x ->
|
||||||
string2varPair s >>= \xy -> alphaConvert cgr xy x
|
string2varPair s >>= \xy -> alphaConvert cgr xy x
|
||||||
{- ----
|
|
||||||
CRefineWithTree s -> action2commandNext $ \x ->
|
CRefineWithTree s -> action2commandNext $ \x ->
|
||||||
(string2treeErr cgr s x >>=
|
(string2treeInState gr s x >>=
|
||||||
\t -> refineWithTree der cgr t x)
|
\t -> refineWithTree der cgr t x)
|
||||||
|
|
||||||
CRefineParse str -> \s -> refineByTrees der cgr
|
|
||||||
(parseAny agrs (cat2CFCat (actCat (stateSState s))) str) s
|
|
||||||
-}
|
|
||||||
CRefineParse str -> \s ->
|
CRefineParse str -> \s ->
|
||||||
let cat = cat2CFCat (qualifTop sgr (actCat (stateSState s)))
|
let cat = cat2CFCat (qualifTop sgr (actCat (stateSState s)))
|
||||||
ts = parseAny agrs cat str
|
ts = parseAny agrs cat str
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module Today where today = "Thu Oct 2 09:28:27 CEST 2003"
|
module Today where today = "Thu Oct 2 18:51:58 CEST 2003"
|
||||||
|
|||||||
Reference in New Issue
Block a user