@@ -1177,6 +1177,7 @@ mapPTermFC f g (PDoBlock dos) = PDoBlock (map mapPDoFC dos)
11771177 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
11781178 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
11791179 mapPDoFC (DoLetP fc t1 t2) = DoLetP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1180+ mapPDoFC (DoRewrite fc h) = DoRewrite (f fc) (mapPTermFC f g h)
11801181mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
11811182mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
11821183mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
@@ -1301,6 +1302,7 @@ data PDo' t = DoExp FC t
13011302 | DoBindP FC t t [(t,t)]
13021303 | DoLet FC Name FC t t -- ^ second FC is precise name location
13031304 | DoLetP FC t t
1305+ | DoRewrite FC t -- rewrite in do block
13041306 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
13051307{-!
13061308deriving instance Binary PDo'
@@ -1312,6 +1314,7 @@ instance Sized a => Sized (PDo' a) where
13121314 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
13131315 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
13141316 size (DoLetP fc l r) = 1 + size fc + size l + size r
1317+ size (DoRewrite fc h) = 1 + size fc + size h
13151318
13161319type PDo = PDo' PTerm
13171320
@@ -1407,6 +1410,7 @@ highestFC (PDoBlock lines) =
14071410 getDoFC (DoBindP fc l r alts) = fc
14081411 getDoFC (DoLet fc nm nfc l r) = fc
14091412 getDoFC (DoLetP fc l r) = fc
1413+ getDoFC (DoRewrite fc h) = fc
14101414
14111415highestFC (PIdiom fc _) = Just fc
14121416highestFC (PMetavar fc _) = Just fc
@@ -2081,6 +2085,9 @@ pprintPTerm ppo bnd docArgs infixes = prettySe (ppopt_depth ppo) startPrec bnd
20812085 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
20822086 text "no pretty printer for pattern-matching do binding" :
20832087 ppdo bnd dos
2088+ ppdo bnd (DoRewrite _ _ : dos) = -- ok because never made by delab
2089+ text "no pretty printer for pattern-matching do binding" :
2090+ ppdo bnd dos
20842091 ppdo _ [] = []
20852092 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
20862093 prettySe d p bnd (PElabError s) = pretty s