forked from GitHub/gf-core
"Committed_by_peb"
This commit is contained in:
@@ -18,5 +18,6 @@ getCanonModule file = do
|
||||
getCanonGrammar :: FilePath -> IOE CanonGrammar
|
||||
getCanonGrammar file = do
|
||||
s <- ioeIO $ readFileIf file
|
||||
c <- ioeErr {- $ err2err -} $ pCanon $ myLexer s
|
||||
-- c <- ioeErr $ err2err $ pCanon $ myLexer s
|
||||
c <- ioeErr $ pCanon $ myLexer s
|
||||
return $ canon2grammar c
|
||||
|
||||
@@ -669,7 +669,7 @@ checkEqLType env t u trm = do
|
||||
|
||||
(RecType rs, RecType ts) -> -- and [alpha g a b && l == k --- too strong req
|
||||
-- | ((l,a),(k,b)) <- zip rs ts]
|
||||
-- || -- if fails, try subtyping:
|
||||
-- . || -- if fails, try subtyping:
|
||||
all (\ (l,a) ->
|
||||
any (\ (k,b) -> alpha g a b && l == k) ts) rs
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ topoSort g = reverse $ tsort 0 [ffs | ffs@(f,_) <- g, inDeg f == 0] [] where
|
||||
|
||||
-- the generic fix point iterator
|
||||
|
||||
iterFix :: Eq a => ([a] -> [a]) -> [a] -> [a]
|
||||
iterFix :: Eq a => ([a] -> [a]) -> [a] -> [a]
|
||||
iterFix more start = iter start start
|
||||
where
|
||||
iter old new = if (null new')
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
----------------------------------------------------------------------
|
||||
-- |
|
||||
-- Module: GFModes
|
||||
-- Responsible: Aarne Ranta (aarne@cs.chalmers.se)
|
||||
-- Time-stamp: <2005-02-02, 15:24>
|
||||
-- Module : Main
|
||||
-- Maintainer : Aarne Ranta
|
||||
-- Stability : (stability)
|
||||
-- Portability : (portability)
|
||||
--
|
||||
-- (Description of the module)
|
||||
----------------------------------------------------------------------
|
||||
-- > CVS $Date: 2005/02/03 15:13:36 $
|
||||
-- > CVS $Author: peb $
|
||||
-- > CVS $Revision: 1.4 $
|
||||
--
|
||||
-- (Description)
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
module GFModes (gfInteract, gfBatch, batchCompile) where
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ pCommand = pCommandWords . words where
|
||||
pCommandWords s = case s of
|
||||
"n" : cat : _ -> CNewCat cat
|
||||
"t" : ws -> CNewTree $ unwords ws
|
||||
"g" : ws -> CRefineWithTree $ unwords ws -- *g*ive
|
||||
"g" : ws -> CRefineWithTree $ unwords ws -- example: *g*ive
|
||||
"p" : ws -> CRefineParse $ unwords ws
|
||||
"rc": i : _ -> CRefineWithClip (readIntArg i)
|
||||
">" : i : _ -> CAhead $ readIntArg i
|
||||
|
||||
@@ -44,7 +44,8 @@ data SRG = SRG { grammarName :: String -- ^ grammar name
|
||||
data SRGRule = SRGRule String String [SRGAlt] -- ^ SRG category name, original category name
|
||||
-- and productions
|
||||
type SRGAlt = [Symbol String Token]
|
||||
type CatName = (String,String) -- ^ SRG category name and original name
|
||||
type CatName = (String,String)
|
||||
-- ^ SRG category name and original name
|
||||
|
||||
type CatNames = FiniteMap String String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user