From: timv Date: Wed, 12 Jun 2013 01:51:26 +0000 (-0400) Subject: merge X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=2f7adb6ca7bbf55f62e58d6f50deff3e18061570;p=dyna2 merge --- 2f7adb6ca7bbf55f62e58d6f50deff3e18061570 diff --cc src/Dyna/Backend/Python/Backend.hs index 8499e36,a6e457c..7bbd6e1 --- a/src/Dyna/Backend/Python/Backend.hs +++ b/src/Dyna/Backend/Python/Backend.hs @@@ -290,20 -271,20 +290,23 @@@ printPlanHeader r c mn = d , "'''"] printInitializer :: Handle -> Rule -> Cost -> Actions PyDopeBS -> IO () -printInitializer fh rule@(Rule _ h _ r _ _ ucruxes _) cost dope = do +printInitializer fh rule cost dope = do displayIO fh $ renderPretty 1.0 100 - $ "@_initializers.append" -- <> (uncurry pfa $ MA.fromJust $ findHeadFA h ucruxes) - `above` "def" <+> char '_' <> tupled ["emit"] <> colon + $ "def" <+> char '_' <> tupled ["emit"] <> colon `above` (indent 4 $ printPlanHeader rule cost Nothing) `above` pdope dope <> line + <> "_initializers.append((" <> (pretty $ r_index rule) <> ", _" <> "))" + <> line + <> line + <> line +printUpdate :: Handle -> Rule -> Cost -> Int -> Maybe DFunctAr -> (DVar, DVar) + -> Actions PyDopeBS -> IO () -- XXX INDIR EVAL -printUpdate :: Handle -> Rule -> Cost -> Int -> Maybe DFunctAr -> (DVar, DVar) -> Actions PyDopeBS -> IO () -printUpdate fh rule@(Rule _ h _ r _ _ _ _) cost evalix (Just (f,a)) (hv,v) dope = do +printUpdate _ _ _ _ Nothing _ _ = + dynacPanic "Python backend does not know how to do indirect evaluations" +printUpdate fh rule cost evalix (Just (f,a)) (hv,v) dope = do displayIO fh $ renderPretty 1.0 100 $ "#" <+> (pfa f a) `above` "def" <+> char '_' <> tupled (map pretty [hv,v,"emit"]) <> colon