mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 01:22:51 -06:00
bugfix: GF.Compile.GrammarToGFCC should not strip the parameter values
This commit is contained in:
@@ -309,12 +309,16 @@ canon2canon opts abs cg0 =
|
|||||||
|
|
||||||
-- flatten record arguments of param constructors
|
-- flatten record arguments of param constructors
|
||||||
p2p (f,j) = case j of
|
p2p (f,j) = case j of
|
||||||
ResParam (Just ps) _ ->
|
ResParam (Just ps) (Just vs) ->
|
||||||
ResParam (Just [(c,concatMap unRec cont) | (c,cont) <- ps]) Nothing
|
ResParam (Just [(c,concatMap unRec cont) | (c,cont) <- ps]) (Just (map unrec vs))
|
||||||
_ -> j
|
_ -> j
|
||||||
unRec (bt,x,ty) = case ty of
|
unRec (bt,x,ty) = case ty of
|
||||||
RecType fs -> [ity | (_,typ) <- fs, ity <- unRec (Explicit,identW,typ)]
|
RecType fs -> [ity | (_,typ) <- fs, ity <- unRec (Explicit,identW,typ)]
|
||||||
_ -> [(bt,x,ty)]
|
_ -> [(bt,x,ty)]
|
||||||
|
unrec t = case t of
|
||||||
|
App f (R fs) -> GM.mkApp (unrec f) [unrec u | (_,(_,u)) <- fs]
|
||||||
|
_ -> GM.composSafeOp unrec t
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
trs v = traceD (render (tr v)) v
|
trs v = traceD (render (tr v)) v
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ optimizeModule opts ms m@(name,mi)
|
|||||||
oopts = opts `addOptions` flagsModule m
|
oopts = opts `addOptions` flagsModule m
|
||||||
|
|
||||||
updateEvalInfo mi (i,info) = do
|
updateEvalInfo mi (i,info) = do
|
||||||
info' <- evalInfo oopts ms m i info
|
info' <- evalInfo oopts ms (name,mi) i info
|
||||||
return (updateModule mi i info')
|
return (updateModule mi i info')
|
||||||
|
|
||||||
evalInfo :: Options -> [SourceModule] -> SourceModule -> Ident -> Info -> Err Info
|
evalInfo :: Options -> [SourceModule] -> SourceModule -> Ident -> Info -> Err Info
|
||||||
|
|||||||
Reference in New Issue
Block a user