@@ -1047,6 +1047,7 @@ mapPTermFC f g (PDoBlock dos) = PDoBlock (map mapPDoFC dos)
10471047 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
10481048 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
10491049 mapPDoFC (DoLetP fc t1 t2) = DoLetP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1050+ mapPDoFC (DoRewrite fc h) = DoRewrite (f fc) (mapPTermFC f g h)
10501051mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
10511052mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
10521053mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
@@ -1171,6 +1172,7 @@ data PDo' t = DoExp FC t
11711172 | DoBindP FC t t [(t,t)]
11721173 | DoLet FC Name FC t t -- ^ second FC is precise name location
11731174 | DoLetP FC t t
1175+ | DoRewrite FC t -- rewrite in do block
11741176 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
11751177{-!
11761178deriving instance Binary PDo'
@@ -1182,6 +1184,7 @@ instance Sized a => Sized (PDo' a) where
11821184 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
11831185 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
11841186 size (DoLetP fc l r) = 1 + size fc + size l + size r
1187+ size (DoRewrite fc h) = 1 + size fc + size h
11851188
11861189type PDo = PDo' PTerm
11871190
@@ -1277,6 +1280,7 @@ highestFC (PDoBlock lines) =
12771280 getDoFC (DoBindP fc l r alts) = fc
12781281 getDoFC (DoLet fc nm nfc l r) = fc
12791282 getDoFC (DoLetP fc l r) = fc
1283+ getDoFC (DoRewrite fc h) = fc
12801284
12811285highestFC (PIdiom fc _) = Just fc
12821286highestFC (PMetavar fc _) = Just fc
@@ -1951,6 +1955,9 @@ pprintPTerm ppo bnd docArgs infixes = prettySe (ppopt_depth ppo) startPrec bnd
19511955 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
19521956 text "no pretty printer for pattern-matching do binding" :
19531957 ppdo bnd dos
1958+ ppdo bnd (DoRewrite _ _ : dos) = -- ok because never made by delab
1959+ text "no pretty printer for pattern-matching do binding" :
1960+ ppdo bnd dos
19541961 ppdo _ [] = []
19551962 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
19561963 prettySe d p bnd (PElabError s) = pretty s