@@ -46,7 +46,7 @@ import Data.Sequence (viewr, ViewR(..))
4646 PARA { (TokPara,_) }
4747 STRING { (TokString $$,_) }
4848
49−%monad { Maybe }
49+%monad { Either [LToken] }
5050
5151%name parseParas doc
5252%name parseString seq
@@ -76,7 +76,7 @@ defpara :: { (Inlines, [Blocks]) }
7676
7777para :: { Blocks }
7878 : seq { para' $1 }
79− | codepara { codeBlock $1 }
79+ | codepara { codeBlockWith ([], ["haskell"], []) $1 }
8080 | property { $1 }
8181 | examples { $1 }
8282
@@ -118,16 +118,16 @@ elem1 :: { Inlines }
118118 | URL { makeHyperlink $1 }
119119 | PIC { image $1 $1 mempty }
120120 | ANAME { mempty } -- TODO
121− | IDENT { code $1 }
122− | DQUO strings DQUO { code $2 }
121+ | IDENT { codeWith ([], ["haskell"], []) $1 }
122+ | DQUO strings DQUO { codeWith ([], ["haskell"], []) $2 }
123123
124124strings :: { String }
125125 : STRING { $1 }
126126 | STRING strings { $1 ++ $2 }
127127
128128{
129−happyError :: [LToken] -> Maybe a
130−happyError toks = Nothing
129+happyError :: [LToken] -> Either [LToken] a
130+happyError toks = Left toks
131131
132132para' :: Inlines -> Blocks
133133para' (Many ils) =
@@ -162,7 +162,7 @@ makeProperty s = case strip s of
162162-- | Create an 'Example', stripping superfluous characters as appropriate
163163makeExample :: String -> String -> [String] -> Blocks
164164makeExample prompt expression result =
165− para $ codeWith ([], ["expr"], []) (strip expression ++ "\n")
165+ para $ codeWith ([], ["haskell", "expr"], []) (strip expression ++ "\n")
166166 <> codeWith ([], ["result"], []) (unlines result')
167167 where
168168 -- 1. drop trailing whitespace from the prompt, remember the prefix