@@ -1177,6 +1177,7 @@ mapPTermFC f g (PDoBlock dos) = PDoBlock (map mapPDoFC dos)
1177 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
1177 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
1178 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1178 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1179 mapPDoFC (DoLetP fc t1 t2) = DoLetP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1179 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)
1180mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
1181mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
1181mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
1182mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
1182mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
1183mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
@@ -1301,6 +1302,7 @@ data PDo' t = DoExp FC t
1301 | DoBindP FC t t [(t,t)]
1302 | DoBindP FC t t [(t,t)]
1302 | DoLet FC Name FC t t -- ^ second FC is precise name location
1303 | DoLet FC Name FC t t -- ^ second FC is precise name location
1303 | DoLetP FC t t
1304 | DoLetP FC t t
1305+ | DoRewrite FC t -- rewrite in do block
1304 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
1306 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
1306deriving instance Binary PDo'
1308deriving instance Binary PDo'
@@ -1312,6 +1314,7 @@ instance Sized a => Sized (PDo' a) where
1312 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
1314 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
1313 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
1315 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
1314 size (DoLetP fc l r) = 1 + size fc + size l + size r
1316 size (DoLetP fc l r) = 1 + size fc + size l + size r
1317+ size (DoRewrite fc h) = 1 + size fc + size h
1316type PDo = PDo' PTerm
1319type PDo = PDo' PTerm
@@ -1407,6 +1410,7 @@ highestFC (PDoBlock lines) =
1407 getDoFC (DoBindP fc l r alts) = fc
1410 getDoFC (DoBindP fc l r alts) = fc
1408 getDoFC (DoLet fc nm nfc l r) = fc
1411 getDoFC (DoLet fc nm nfc l r) = fc
1409 getDoFC (DoLetP fc l r) = fc
1412 getDoFC (DoLetP fc l r) = fc
1413+ getDoFC (DoRewrite fc h) = fc
1411highestFC (PIdiom fc _) = Just fc
1415highestFC (PIdiom fc _) = Just fc
1412highestFC (PMetavar fc _) = Just fc
1416highestFC (PMetavar fc _) = Just fc
@@ -2081,6 +2085,9 @@ pprintPTerm ppo bnd docArgs infixes = prettySe (ppopt_depth ppo) startPrec bnd
2081 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
2085 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
2082 text "no pretty printer for pattern-matching do binding" :
2086 text "no pretty printer for pattern-matching do binding" :
2083 ppdo bnd dos
2087 ppdo bnd dos
2088+ ppdo bnd (DoRewrite _ _ : dos) = -- ok because never made by delab
2089+ text "no pretty printer for pattern-matching do binding" :
2084 ppdo _ [] = []
2091 ppdo _ [] = []
2085 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
2092 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
2086 prettySe d p bnd (PElabError s) = pretty s
2093 prettySe d p bnd (PElabError s) = pretty s