drop the -trace option

This commit is contained in:
krangelov
2021-12-15 13:08:10 +01:00
parent f793ed4413
commit 937a78c628
3 changed files with 8 additions and 12 deletions

View File

@@ -7,7 +7,6 @@ import qualified Data.ByteString.UTF8 as UTF8(fromString)
import qualified Data.Map as Map import qualified Data.Map as Map
import GF.Infra.SIO(MonadSIO(..),restricted) import GF.Infra.SIO(MonadSIO(..),restricted)
import GF.Infra.Option(modifyFlags,optTrace) --,noOptions
import GF.Infra.Dependencies(depGraph) import GF.Infra.Dependencies(depGraph)
import GF.Infra.CheckM import GF.Infra.CheckM
import GF.Text.Pretty(render,pp) import GF.Text.Pretty(render,pp)
@@ -257,7 +256,6 @@ checkComputeTerm os sgr t =
greatestResource sgr greatestResource sgr
t <- renameSourceTerm sgr mo t t <- renameSourceTerm sgr mo t
(t,_) <- inferLType sgr [] t (t,_) <- inferLType sgr [] t
let opts = modifyFlags (\fs->fs{optTrace=isOpt "trace" os})
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

View File

@@ -26,6 +26,7 @@ import qualified Data.Map.Strict as Map
import Control.Monad import Control.Monad
import Data.List(mapAccumL,sortBy) import Data.List(mapAccumL,sortBy)
import Data.Maybe(fromMaybe) import Data.Maybe(fromMaybe)
import Debug.Trace
generatePMCFG :: Options -> FilePath -> SourceGrammar -> SourceModule -> Check SourceModule generatePMCFG :: Options -> FilePath -> SourceGrammar -> SourceModule -> Check SourceModule
generatePMCFG opts cwd gr cmo@(cm,cmi) generatePMCFG opts cwd gr cmo@(cm,cmi)
@@ -39,15 +40,15 @@ addPMCFG opts cwd gr cmi (id,CncCat mty@(Just (L loc ty)) mdef mref mprn Nothing
defs <- case mdef of defs <- case mdef of
Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the lindef of" <+> id) $ do Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the lindef of" <+> id) $ do
term <- mkLinDefault gr ty term <- mkLinDefault gr ty
pmcfgForm gr term [(Explicit,identW,typeStr)] ty trace (show id) $ pmcfgForm gr term [(Explicit,identW,typeStr)] ty
Just (L loc term) -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the lindef of" <+> id) $ do Just (L loc term) -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the lindef of" <+> id) $ do
pmcfgForm gr term [(Explicit,identW,typeStr)] ty trace (show id) $ pmcfgForm gr term [(Explicit,identW,typeStr)] ty
refs <- case mref of refs <- case mref of
Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the linref of" <+> id) $ do Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the linref of" <+> id) $ do
term <- mkLinReference gr ty term <- mkLinReference gr ty
pmcfgForm gr term [(Explicit,identW,ty)] typeStr trace (show id) $ pmcfgForm gr term [(Explicit,identW,ty)] typeStr
Just (L loc term) -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the linref of" <+> id) $ do Just (L loc term) -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the linref of" <+> id) $ do
pmcfgForm gr term [(Explicit,identW,ty)] typeStr trace (show id) $ pmcfgForm gr term [(Explicit,identW,ty)] typeStr
mprn <- case mprn of mprn <- case mprn of
Nothing -> return Nothing Nothing -> return Nothing
Just (L loc prn) -> checkInModule cwd cmi loc ("Happened in the computation of the print name for" <+> id) $ do Just (L loc prn) -> checkInModule cwd cmi loc ("Happened in the computation of the print name for" <+> id) $ do
@@ -56,7 +57,7 @@ addPMCFG opts cwd gr cmi (id,CncCat mty@(Just (L loc ty)) mdef mref mprn Nothing
return (id,CncCat mty mdef mref mprn (Just (defs,refs))) return (id,CncCat mty mdef mref mprn (Just (defs,refs)))
addPMCFG opts cwd gr cmi (id,CncFun mty@(Just (_,cat,ctxt,val)) mlin@(Just (L loc term)) mprn Nothing) = do addPMCFG opts cwd gr cmi (id,CncFun mty@(Just (_,cat,ctxt,val)) mlin@(Just (L loc term)) mprn Nothing) = do
rules <- checkInModule cwd cmi loc ("Happened in the PMCFG generation for" <+> id) $ rules <- checkInModule cwd cmi loc ("Happened in the PMCFG generation for" <+> id) $
pmcfgForm gr term ctxt val trace (show id) $ pmcfgForm gr term ctxt val
mprn <- case mprn of mprn <- case mprn of
Nothing -> return Nothing Nothing -> return Nothing
Just (L loc prn) -> checkInModule cwd cmi loc ("Happened in the computation of the print name for" <+> id) $ do Just (L loc prn) -> checkInModule cwd cmi loc ("Happened in the computation of the print name for" <+> id) $ do

View File

@@ -182,8 +182,7 @@ data Flags = Flags {
optHeuristicFactor :: Maybe Double, optHeuristicFactor :: Maybe Double,
optCaseSensitive :: Bool, optCaseSensitive :: Bool,
optPlusAsBind :: Bool, optPlusAsBind :: Bool,
optJobs :: Maybe (Maybe Int), optJobs :: Maybe (Maybe Int)
optTrace :: Bool
} }
deriving (Show) deriving (Show)
@@ -294,8 +293,7 @@ defaultFlags = Flags {
optHeuristicFactor = Nothing, optHeuristicFactor = Nothing,
optCaseSensitive = True, optCaseSensitive = True,
optPlusAsBind = False, optPlusAsBind = False,
optJobs = Nothing, optJobs = Nothing
optTrace = False
} }
-- | Option descriptions -- | Option descriptions
@@ -410,7 +408,6 @@ optDescr =
Just i -> set $ \o -> o { optVerbosity = i } Just i -> set $ \o -> o { optVerbosity = i }
Nothing -> fail $ "Bad verbosity: " ++ show v Nothing -> fail $ "Bad verbosity: " ++ show v
cpu x = set $ \o -> o { optShowCPUTime = x } cpu x = set $ \o -> o { optShowCPUTime = x }
-- trace x = set $ \o -> o { optTrace = x }
gfoDir x = set $ \o -> o { optGFODir = Just x } gfoDir x = set $ \o -> o { optGFODir = Just x }
outFmt x = readOutputFormat x >>= \f -> outFmt x = readOutputFormat x >>= \f ->
set $ \o -> o { optOutputFormats = optOutputFormats o ++ [f] } set $ \o -> o { optOutputFormats = optOutputFormats o ++ [f] }