diff --git a/src/compiler/GF/Command/SourceCommands.hs b/src/compiler/GF/Command/SourceCommands.hs index c44ac5685..2c505d4db 100644 --- a/src/compiler/GF/Command/SourceCommands.hs +++ b/src/compiler/GF/Command/SourceCommands.hs @@ -7,7 +7,6 @@ import qualified Data.ByteString.UTF8 as UTF8(fromString) import qualified Data.Map as Map import GF.Infra.SIO(MonadSIO(..),restricted) -import GF.Infra.Option(modifyFlags,optTrace) --,noOptions import GF.Infra.Dependencies(depGraph) import GF.Infra.CheckM import GF.Text.Pretty(render,pp) @@ -257,7 +256,6 @@ checkComputeTerm os sgr t = greatestResource sgr t <- renameSourceTerm sgr mo t (t,_) <- inferLType sgr [] t - let opts = modifyFlags (\fs->fs{optTrace=isOpt "trace" os}) fmap evalStr (normalForm sgr t) where -- ** Try to compute pre{...} tokens in token sequences diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index 6708e8e9c..39c0d7195 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -26,6 +26,7 @@ import qualified Data.Map.Strict as Map import Control.Monad import Data.List(mapAccumL,sortBy) import Data.Maybe(fromMaybe) +import Debug.Trace generatePMCFG :: Options -> FilePath -> SourceGrammar -> SourceModule -> Check SourceModule 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 Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the lindef of" <+> id) $ do 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 - pmcfgForm gr term [(Explicit,identW,typeStr)] ty + trace (show id) $ pmcfgForm gr term [(Explicit,identW,typeStr)] ty refs <- case mref of Nothing -> checkInModule cwd cmi loc ("Happened in the PMCFG generation for the linref of" <+> id) $ do 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 - pmcfgForm gr term [(Explicit,identW,ty)] typeStr + trace (show id) $ pmcfgForm gr term [(Explicit,identW,ty)] typeStr mprn <- case mprn of Nothing -> return Nothing 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))) 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) $ - pmcfgForm gr term ctxt val + trace (show id) $ pmcfgForm gr term ctxt val mprn <- case mprn of Nothing -> return Nothing Just (L loc prn) -> checkInModule cwd cmi loc ("Happened in the computation of the print name for" <+> id) $ do diff --git a/src/compiler/GF/Infra/Option.hs b/src/compiler/GF/Infra/Option.hs index 129292b38..85907b12c 100644 --- a/src/compiler/GF/Infra/Option.hs +++ b/src/compiler/GF/Infra/Option.hs @@ -182,8 +182,7 @@ data Flags = Flags { optHeuristicFactor :: Maybe Double, optCaseSensitive :: Bool, optPlusAsBind :: Bool, - optJobs :: Maybe (Maybe Int), - optTrace :: Bool + optJobs :: Maybe (Maybe Int) } deriving (Show) @@ -294,8 +293,7 @@ defaultFlags = Flags { optHeuristicFactor = Nothing, optCaseSensitive = True, optPlusAsBind = False, - optJobs = Nothing, - optTrace = False + optJobs = Nothing } -- | Option descriptions @@ -410,7 +408,6 @@ optDescr = Just i -> set $ \o -> o { optVerbosity = i } Nothing -> fail $ "Bad verbosity: " ++ show v cpu x = set $ \o -> o { optShowCPUTime = x } --- trace x = set $ \o -> o { optTrace = x } gfoDir x = set $ \o -> o { optGFODir = Just x } outFmt x = readOutputFormat x >>= \f -> set $ \o -> o { optOutputFormats = optOutputFormats o ++ [f] }