Skip to content

Commit bbc87ba

Browse files
committed
chore: bump agda
1 parent 4ad8937 commit bbc87ba

File tree

2 files changed

+7
-32
lines changed

2 files changed

+7
-32
lines changed

support/nix/dep/Agda/github.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"repo": "agda",
44
"branch": "master",
55
"private": false,
6-
"rev": "e717572aa1dcc976b3a4b5b977fcfaf5a60fe3e2",
7-
"sha256": "0y7bspb6gdpxzqg9qcsbidmpq3n8wwz54w5zvqz6mwbyl2sqm8k5"
6+
"rev": "0feec2519d580aaf8cc18b791c16790ca738bfd1",
7+
"sha256": "0jsmj2rrjnxw9zxklrddh2i96qdqwzrar4r6s725vpjm659ss714"
88
}

support/shake/app/HTML/Render.hs

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Agda.Syntax.Common.Pretty
1111

1212
import Agda.Utils.Impossible (__IMPOSSIBLE__)
1313
import Agda.Utils.Function
14+
import Agda.Utils.DocTree
1415

1516
import Control.DeepSeq
1617
import Control.Monad
@@ -38,41 +39,15 @@ import qualified Text.Blaze.Html5.Attributes as Attr
3839
import Text.Blaze.Html.Renderer.Text ( renderHtml )
3940
import Text.Blaze.Html5 as Html hiding (map)
4041

41-
data DocTree = Node Aspects [DocTree] | Text Text.Text | Mark (Maybe Aspects)
42-
4342
renderToHtml :: Doc -> Text
44-
renderToHtml = finish . Ppr.fullRenderAnn Ppr.PageMode 100 1.5 cont [] where
45-
consText (Ppr.Chr c) (Text t:ts) = Text (c `Text.cons` t):ts
46-
consText (Ppr.Str c) (Text t:ts) = Text (Text.pack c <> t):ts
47-
consText (Ppr.PStr c) (Text t:ts) = Text (Text.pack c <> t):ts
48-
consText (Ppr.Chr c) ts = Text (Text.singleton c):ts
49-
consText (Ppr.Str c) ts = Text (Text.pack c):ts
50-
consText (Ppr.PStr c) ts = Text (Text.pack c):ts
51-
52-
annotate acc (Mark (Just t):ts) = Node t (reverse acc):ts
53-
annotate acc (Mark Nothing:ts) = reverse acc <> ts
54-
annotate acc (t:ts) = annotate (t:acc) ts
55-
annotate acc [] = __IMPOSSIBLE__
56-
57-
cont :: Ppr.AnnotDetails Aspects -> [DocTree] -> [DocTree]
58-
cont ann acc = case ann of
59-
Ppr.AnnotStart -> annotate [] acc
60-
Ppr.NoAnnot d _ -> consText d acc
61-
Ppr.AnnotEnd a
62-
| _:_ <- toAtoms a -> Mark (Just a):acc
63-
| otherwise -> Mark Nothing:acc -- uncurry (<>) (break acc)
64-
65-
toBlaze :: DocTree -> Html
66-
toBlaze (Mark _) = __IMPOSSIBLE__
67-
toBlaze (Text t) = Html.text t
68-
toBlaze (Node a t) = Html.span do
69-
aspectsToHtml Nothing mempty Nothing a $
70-
traverse_ toBlaze t
43+
renderToHtml = finish . renderTree' Html.text toblaze . renderToTree where
44+
toblaze a t = Html.span do
45+
aspectsToHtml Nothing mempty Nothing a t
7146
unless (null (note a)) do
7247
Html.span (string (note a)) !! [Attr.class_ "Note"]
7348

7449
finish = Tl.toStrict . renderHtml . wrapper
75-
wrapper = (!! [Attr.class_ "Agda"]) . Html.pre . traverse_ toBlaze
50+
wrapper = (!! [Attr.class_ "Agda"]) . Html.pre
7651

7752
-- | Data about an identifier
7853
data Identifier = Identifier

0 commit comments

Comments
 (0)