forked from GitHub/gf-core
code cleanup
This commit is contained in:
@@ -255,7 +255,7 @@ checkComputeTerm os sgr t =
|
||||
do mo <- maybe (checkError (pp "no source grammar in scope")) return $
|
||||
greatestResource sgr
|
||||
t <- renameSourceTerm sgr mo t
|
||||
(t,_) <- inferLType sgr [] t
|
||||
(t,_) <- inferLType sgr [] t
|
||||
fmap evalStr (normalForm sgr t)
|
||||
where
|
||||
-- ** Try to compute pre{...} tokens in token sequences
|
||||
|
||||
@@ -844,12 +844,7 @@ ppType ty =
|
||||
_ -> ppTerm Unqualified 0 ty
|
||||
Prod _ x a b -> ppType a <+> "->" <+> ppType b
|
||||
_ -> ppTerm Unqualified 0 ty
|
||||
{-
|
||||
ppqType :: Type -> Type -> Doc
|
||||
ppqType t u = case (ppType t, ppType u) of
|
||||
(pt,pu) | render pt == render pu -> ppTerm Qualified 0 t
|
||||
(pt,_) -> pt
|
||||
-}
|
||||
|
||||
checkLookup :: Ident -> Context -> Check Type
|
||||
checkLookup x g =
|
||||
case [ty | (b,y,ty) <- g, x == y] of
|
||||
|
||||
@@ -41,8 +41,6 @@ import GF.Grammar.Predef
|
||||
import GF.Grammar.Lockfield
|
||||
|
||||
import Data.List (sortBy)
|
||||
--import Data.Maybe (maybe)
|
||||
--import Control.Monad
|
||||
import GF.Text.Pretty
|
||||
import qualified Data.Map as Map
|
||||
|
||||
|
||||
@@ -152,12 +152,6 @@ isVariable :: Term -> Bool
|
||||
isVariable (Vr _ ) = True
|
||||
isVariable _ = False
|
||||
|
||||
--eqIdent :: Ident -> Ident -> Bool
|
||||
--eqIdent = (==)
|
||||
|
||||
uType :: Type
|
||||
uType = Cn cUndefinedType
|
||||
|
||||
-- *** Assignment
|
||||
|
||||
assign :: Label -> Term -> Assign
|
||||
|
||||
@@ -23,12 +23,10 @@ cPredef = moduleNameS "Predef"
|
||||
cInt = identS "Int"
|
||||
cFloat = identS "Float"
|
||||
cString = identS "String"
|
||||
cVar = identS "__gfVar"
|
||||
cInts = identS "Ints"
|
||||
cPBool = identS "PBool"
|
||||
cErrorType = identS "Error"
|
||||
cOverload = identS "overload"
|
||||
cUndefinedType = identS "UndefinedType"
|
||||
cNonExist = identS "nonExist"
|
||||
cBIND = identS "BIND"
|
||||
cSOFT_BIND = identS "SOFT_BIND"
|
||||
|
||||
@@ -269,7 +269,7 @@ defaultFlags = Flags {
|
||||
optBlank = Nothing,
|
||||
optSISR = Nothing,
|
||||
optHaskellOptions = Set.empty,
|
||||
optLiteralCats = Set.fromList [cString,cInt,cFloat,cVar],
|
||||
optLiteralCats = Set.fromList [cString,cInt,cFloat],
|
||||
optLexicalCats = Set.empty,
|
||||
optGFODir = Nothing,
|
||||
optOutputDir = Nothing,
|
||||
|
||||
@@ -13,7 +13,6 @@ import GF.Command.Help(helpCommand)
|
||||
import GF.Command.Abstract
|
||||
import GF.Command.Parse(readCommandLine,pCommand,readTransactionCommand)
|
||||
import GF.Compile.Rename(renameSourceTerm)
|
||||
import GF.Compile.CheckGrammar(linTypeOfType)
|
||||
import GF.Compile.TypeCheck.Concrete(inferLType)
|
||||
import GF.Compile.GeneratePMCFG(pmcfgForm)
|
||||
import GF.Data.Operations (Err(..))
|
||||
|
||||
Reference in New Issue
Block a user