diff options
| author | adelon <22380201+adelon@users.noreply.github.com> | 2026-05-18 00:55:16 +0200 |
|---|---|---|
| committer | adelon <22380201+adelon@users.noreply.github.com> | 2026-05-18 00:55:16 +0200 |
| commit | 827d73a91ed0fb3dfff56379ebea21a29406a277 (patch) | |
| tree | 76ce0738ca057db6177b817ce0d617f2111fd295 /src/compiler/GF/Compile/PMCFGTestHooks.hs | |
| parent | 3cc01b9d311c7a9f86fbf2fa8c2d66921f9ba030 (diff) | |
Tests
Diffstat (limited to 'src/compiler/GF/Compile/PMCFGTestHooks.hs')
| -rw-r--r-- | src/compiler/GF/Compile/PMCFGTestHooks.hs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/compiler/GF/Compile/PMCFGTestHooks.hs b/src/compiler/GF/Compile/PMCFGTestHooks.hs new file mode 100644 index 000000000..e8014107e --- /dev/null +++ b/src/compiler/GF/Compile/PMCFGTestHooks.hs @@ -0,0 +1,43 @@ +module GF.Compile.PMCFGTestHooks + ( TestSchema(..) + , TestProduction(..) + , PMCFGResults(..) + , getFIdsPre + , getFIdsOptimized + , getFIdsOptimizedCached + , getSingleFIdPre + , getSingleFIdOptimized + , pmcfgResults + ) where + +import GF.Compile.PMCFGTestTypes +import GF.Grammar (FId, PMCFG) +import qualified GF.Compile.GeneratePMCFG as Optimized +import qualified GF.Compile.GeneratePmcfgPre as Pre + +data PMCFGResults = PMCFGResults + { pmcfgPre :: PMCFG + , pmcfgOptimized :: PMCFG + } deriving (Eq, Show) + +getFIdsPre :: TestSchema -> [FId] +getFIdsPre = Pre.pmcfgTestGetFIds + +getFIdsOptimized :: TestSchema -> [FId] +getFIdsOptimized = Optimized.pmcfgTestGetFIds + +getFIdsOptimizedCached :: TestSchema -> ([FId], [FId]) +getFIdsOptimizedCached = Optimized.pmcfgTestGetFIdsCached + +getSingleFIdPre :: TestSchema -> FId +getSingleFIdPre = Pre.pmcfgTestGetSingleFId + +getSingleFIdOptimized :: TestSchema -> FId +getSingleFIdOptimized = Optimized.pmcfgTestGetSingleFId + +pmcfgResults :: [TestProduction] -> PMCFGResults +pmcfgResults prods = + PMCFGResults + { pmcfgPre = Pre.pmcfgTestBuildPMCFG prods + , pmcfgOptimized = Optimized.pmcfgTestBuildPMCFG prods + } |
