diff options
| author | hallgren <hallgren@chalmers.se> | 2012-12-20 16:41:43 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-12-20 16:41:43 +0000 |
| commit | 12dec2503d5ffd7cb39f58c7fa1810d65063ef71 (patch) | |
| tree | 2710489d4d1fd87bf175557e94a7a607ed52b321 | |
| parent | 5ff33f47be003088bd5a5b0e5b7c35a83151a751 (diff) | |
bug fix in the new partial evaluator
It can leave wildcard tables in their origial form, but it easy to handle
them in the unfactor function in GeneratePMCFG.
| -rw-r--r-- | src/compiler/GF/Compile/GeneratePMCFG.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index f733f5a0a..dca1f74fd 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -148,10 +148,18 @@ unfactor t = CM (\gr c -> c (unfac gr t)) where unfac gr t = case t of - T (TTyped ty) [(PV x,u)] -> V ty [restore x v (unfac gr u) | v <- err bug id (allParamValues gr ty)] - T (TTyped ty) _ -> ppbug $ text "unfactor"<+>ppTerm Unqualified 10 t + T (TTyped ty) [(PV x,u)] -> let u' = unfac gr u + in V ty [restore x v u' | v <- allparams ty] + T (TTyped ty) [(PW ,u)] -> let u' = unfac gr u + in V ty [u' | _ <- allparams ty] + T (TTyped ty) _ -> -- converTerm doesn't handle these tables + ppbug $ + sep [text "unfactor"<+>ppTerm Unqualified 10 t, + text (show t)] _ -> composSafeOp (unfac gr) t where + allparams ty = err bug id (allParamValues gr ty) + restore x u t = case t of Vr y | y == x -> u _ -> composSafeOp (restore x u) t |
