forked from GitHub/gf-core
documenting testgf3
This commit is contained in:
@@ -429,10 +429,8 @@ inferLType gr trm = case trm of
|
||||
|
||||
QC m ident -> checks [
|
||||
termWith trm $ checkErr (lookupOperType gr m ident) >>= comp
|
||||
,
|
||||
checkErr (lookupOperDef gr m ident) >>= infer
|
||||
,
|
||||
prtFail "cannot infer type of canonical constant" trm
|
||||
-- ,checkErr (lookupOperDef gr m ident) >>= infer
|
||||
-- ,prtFail "cannot infer type of canonical constant" trm
|
||||
]
|
||||
|
||||
Val ty i -> termWith trm $ return ty
|
||||
|
||||
@@ -14,7 +14,7 @@ import GF.Devel.Grammar.Construct
|
||||
import GF.Infra.Ident
|
||||
import GF.Devel.Grammar.PrGF
|
||||
----import GF.Devel.Grammar.Lookup
|
||||
import GF.Devel.ReadFiles
|
||||
import GF.Devel.Infra.ReadFiles
|
||||
|
||||
import GF.Infra.Option ----
|
||||
import GF.Data.Operations
|
||||
@@ -102,7 +102,7 @@ compileOne opts env@(_,srcgr) file = do
|
||||
-- for compiled gf, read the file and update environment
|
||||
-- also undo common subexp optimization, to enable normal computations
|
||||
|
||||
"gfo" -> do
|
||||
"gfn" -> do
|
||||
sm0 <- putp ("+ reading" +++ file) $ getSourceModule opts file
|
||||
let sm1 = unsubexpModule sm0
|
||||
sm <- {- putp "creating indirections" $ -} ioeErr $ extendModule srcgr sm1
|
||||
|
||||
@@ -13,7 +13,7 @@ comment "{-" "-}" ;
|
||||
|
||||
-- identifiers
|
||||
|
||||
position token PIdent ('_')? letter (letter | digit | '_' | '\'')* ;
|
||||
position token PIdent ('_' | letter) (letter | digit | '_' | '\'')* ;
|
||||
|
||||
-- the top-level grammar
|
||||
|
||||
|
||||
@@ -444,6 +444,7 @@ transExp x = case x of
|
||||
---- ELin id -> liftM G.LiT $ transIdent id
|
||||
|
||||
EEqs eqs -> liftM G.Eqs $ mapM transEquation eqs
|
||||
EData -> return G.EData
|
||||
|
||||
_ -> Bad $ "translation not yet defined for" +++ printTree x ----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user