@@ -1047,6 +1047,7 @@ mapPTermFC f g (PDoBlock dos) = PDoBlock (map mapPDoFC dos)
1047 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
1047 DoBindP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2) (map (\(l,r)-> (mapPTermFC f g l, mapPTermFC f g r)) alts)
1048 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1048 mapPDoFC (DoLet fc n nfc t1 t2) = DoLet (f fc) n (g nfc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1049 mapPDoFC (DoLetP fc t1 t2) = DoLetP (f fc) (mapPTermFC f g t1) (mapPTermFC f g t2)
1049 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)
1050mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
1051mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
1051mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
1052mapPTermFC f g (PMetavar fc n) = PMetavar (g fc) n
1052mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
1053mapPTermFC f g (PProof tacs) = PProof (map (fmap (mapPTermFC f g)) tacs)
@@ -1171,6 +1172,7 @@ data PDo' t = DoExp FC t
1171 | DoBindP FC t t [(t,t)]
1172 | DoBindP FC t t [(t,t)]
1172 | DoLet FC Name FC t t -- ^ second FC is precise name location
1173 | DoLet FC Name FC t t -- ^ second FC is precise name location
1173 | DoLetP FC t t
1174 | DoLetP FC t t
1175+ | DoRewrite FC t -- rewrite in do block
1174 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
1176 deriving (Eq, Ord, Functor, Data, Generic, Typeable)
1176deriving instance Binary PDo'
1178deriving instance Binary PDo'
@@ -1182,6 +1184,7 @@ instance Sized a => Sized (PDo' a) where
1182 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
1184 size (DoBindP fc l r alts) = 1 + size fc + size l + size r + size alts
1183 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
1185 size (DoLet fc nm nfc l r) = 1 + size fc + size nm + size l + size r
1184 size (DoLetP fc l r) = 1 + size fc + size l + size r
1186 size (DoLetP fc l r) = 1 + size fc + size l + size r
1187+ size (DoRewrite fc h) = 1 + size fc + size h
1186type PDo = PDo' PTerm
1189type PDo = PDo' PTerm
@@ -1277,6 +1280,7 @@ highestFC (PDoBlock lines) =
1277 getDoFC (DoBindP fc l r alts) = fc
1280 getDoFC (DoBindP fc l r alts) = fc
1278 getDoFC (DoLet fc nm nfc l r) = fc
1281 getDoFC (DoLet fc nm nfc l r) = fc
1279 getDoFC (DoLetP fc l r) = fc
1282 getDoFC (DoLetP fc l r) = fc
1283+ getDoFC (DoRewrite fc h) = fc
1281highestFC (PIdiom fc _) = Just fc
1285highestFC (PIdiom fc _) = Just fc
1282highestFC (PMetavar fc _) = Just fc
1286highestFC (PMetavar fc _) = Just fc
@@ -1951,6 +1955,9 @@ pprintPTerm ppo bnd docArgs infixes = prettySe (ppopt_depth ppo) startPrec bnd
1951 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
1955 ppdo bnd (DoLetP _ _ _ : dos) = -- ok because never made by delab
1952 text "no pretty printer for pattern-matching do binding" :
1956 text "no pretty printer for pattern-matching do binding" :
1953 ppdo bnd dos
1957 ppdo bnd dos
1958+ ppdo bnd (DoRewrite _ _ : dos) = -- ok because never made by delab
1959+ text "no pretty printer for pattern-matching do binding" :
1954 ppdo _ [] = []
1961 ppdo _ [] = []
1955 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
1962 prettySe d p bnd (PCoerced t) = prettySe d p bnd t
1956 prettySe d p bnd (PElabError s) = pretty s
1963 prettySe d p bnd (PElabError s) = pretty s