mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 01:22:51 -06:00
make sure that everything is evaluated before conversion
This commit is contained in:
@@ -143,13 +143,23 @@ flatten (VV _ tnks) (Table _ q) st = do
|
|||||||
v <- force tnk
|
v <- force tnk
|
||||||
flatten v q st
|
flatten v q st
|
||||||
flatten v (Sort s) (lins,params) | s == cStr = do
|
flatten v (Sort s) (lins,params) | s == cStr = do
|
||||||
|
deepForce v
|
||||||
return (v:lins,params)
|
return (v:lins,params)
|
||||||
flatten v ty@(QC q) (lins,params) = do
|
flatten v ty@(QC q) (lins,params) = do
|
||||||
|
deepForce v
|
||||||
return (lins,(v,ty):params)
|
return (lins,(v,ty):params)
|
||||||
flatten v ty (lins,params)
|
flatten v ty (lins,params)
|
||||||
| Just n <- isTypeInts ty = return (lins,(v,ty):params)
|
| Just n <- isTypeInts ty = do deepForce v
|
||||||
|
return (lins,(v,ty):params)
|
||||||
| otherwise = error (showValue v)
|
| otherwise = error (showValue v)
|
||||||
|
|
||||||
|
deepForce (VR as) = mapM_ (\(lbl,v) -> force v >>= deepForce) as
|
||||||
|
deepForce (VApp q tnks) = mapM_ (\tnk -> force tnk >>= deepForce) tnks
|
||||||
|
deepForce (VC vs) = mapM_ deepForce vs
|
||||||
|
deepForce (VAlts def alts) = do deepForce def
|
||||||
|
mapM_ (\(v,_) -> deepForce v) alts
|
||||||
|
deepForce _ = return ()
|
||||||
|
|
||||||
str2lin (VApp q [])
|
str2lin (VApp q [])
|
||||||
| q == (cPredef, cBIND) = return [SymBIND]
|
| q == (cPredef, cBIND) = return [SymBIND]
|
||||||
| q == (cPredef, cNonExist) = return [SymNE]
|
| q == (cPredef, cNonExist) = return [SymNE]
|
||||||
|
|||||||
Reference in New Issue
Block a user