mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 03:09:33 -06:00
type check cc command
This commit is contained in:
@@ -65,6 +65,13 @@ checkModule ms (name,mod) = checkIn ("checking module" +++ prt name) $ case mod
|
||||
where
|
||||
gr = MGrammar $ (name,mod):ms
|
||||
|
||||
-- check if a term is typable
|
||||
|
||||
justCheckLTerm :: SourceGrammar -> Term -> Err Term
|
||||
justCheckLTerm src t = do
|
||||
((t',_),_) <- checkStart (inferLType src t)
|
||||
return t'
|
||||
|
||||
checkAbsInfo :: SourceGrammar -> Ident -> (Ident,Info) -> Check (Ident,Info)
|
||||
checkAbsInfo st m (c,info) = do
|
||||
---- checkReservedId c
|
||||
|
||||
@@ -5,6 +5,7 @@ import Str
|
||||
import qualified Grammar as G
|
||||
import qualified Ident as I
|
||||
import qualified Compute as Co
|
||||
import qualified CheckGrammar as Ch
|
||||
import qualified Lookup as L
|
||||
import qualified GFC
|
||||
import qualified Look
|
||||
@@ -169,7 +170,9 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
|
||||
maybe (resourceOfShellState st) (return . I.identC) $ -- topmost res
|
||||
getOptVal opts useResource -- flag -res=m
|
||||
justOutput (putStrLn (err id (prt . stripTerm) (
|
||||
string2srcTerm src m t >>= Co.computeConcrete src))) sa
|
||||
string2srcTerm src m t >>=
|
||||
Ch.justCheckLTerm src >>=
|
||||
Co.computeConcrete src))) sa
|
||||
CShowOpers t -> do
|
||||
m <- return $
|
||||
maybe (I.identC "?") id $ -- meaningful if no opers in t
|
||||
|
||||
Reference in New Issue
Block a user