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