1
0
forked from GitHub/gf-core

code cleanup

This commit is contained in:
Krasimir Angelov
2021-12-28 13:38:19 +01:00
parent c9b90a509c
commit 16b0eea568
7 changed files with 3 additions and 19 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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,

View File

@@ -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(..))