diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock/Interface/LexParseRn.hs | 8 | ||||
-rw-r--r-- | src/Haddock/Lex.x (renamed from src/Haddock/Interface/Lex.x) | 5 | ||||
-rw-r--r-- | src/Haddock/Parse.y (renamed from src/Haddock/Interface/Parse.y) | 11 | ||||
-rw-r--r-- | src/Main.hs | 6 |
4 files changed, 14 insertions, 16 deletions
diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index fc44cedf..89440139 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -19,8 +19,8 @@ module Haddock.Interface.LexParseRn ( ) where import Haddock.Types -import Haddock.Interface.Lex -import Haddock.Interface.Parse +import Haddock.Lex +import Haddock.Parse import Haddock.Interface.Rn import Haddock.Interface.ParseModuleHeader import Haddock.Doc @@ -46,8 +46,8 @@ lexParseRnHaddockComment hty gre (HsDocString fs) = do let str = unpackFS fs let toks = tokenise str let parse = case hty of - NormalHaddockComment -> parseHaddockParagraphs - DocSectionComment -> parseHaddockString + NormalHaddockComment -> parseParas + DocSectionComment -> parseString case parse toks of Nothing -> do tell ["doc comment parse failed: "++str] diff --git a/src/Haddock/Interface/Lex.x b/src/Haddock/Lex.x index 5f93084a..04b9f0c3 100644 --- a/src/Haddock/Interface/Lex.x +++ b/src/Haddock/Lex.x @@ -3,7 +3,8 @@ -- -- (c) Simon Marlow 2002 -- --- This file was modified and integrated into GHC by David Waern 2006 +-- This file was modified and integrated into GHC by David Waern 2006. +-- Then moved back into Haddock by Isaac Dupree in 2009 :-) -- { @@ -14,7 +15,7 @@ -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details -module Haddock.Interface.Lex ( +module Haddock.Lex ( Token(..), tokenise ) where diff --git a/src/Haddock/Interface/Parse.y b/src/Haddock/Parse.y index a5175ddc..42553343 100644 --- a/src/Haddock/Interface/Parse.y +++ b/src/Haddock/Parse.y @@ -6,12 +6,9 @@ -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details -module Haddock.Interface.Parse ( - parseHaddockParagraphs, - parseHaddockString -) where +module Haddock.Parse where -import Haddock.Interface.Lex +import Haddock.Lex import Haddock.Types (Doc(..)) import Haddock.Doc import HsSyn @@ -40,8 +37,8 @@ import RdrName %monad { Maybe } -%name parseHaddockParagraphs doc -%name parseHaddockString seq +%name parseParas doc +%name parseString seq %% diff --git a/src/Main.hs b/src/Main.hs index f09dcd29..1f4867e4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -22,8 +22,8 @@ module Main (main) where import Haddock.Backends.Html import Haddock.Backends.Hoogle import Haddock.Interface -import Haddock.Interface.Lex -import Haddock.Interface.Parse +import Haddock.Lex +import Haddock.Parse import Haddock.Types import Haddock.Version import Haddock.InterfaceFile @@ -400,7 +400,7 @@ getPrologue flags = [] -> return Nothing [filename] -> do str <- readFile filename - case parseHaddockParagraphs (tokenise str) of + case parseParas (tokenise str) of Nothing -> throwE "parsing haddock prologue failed" Just doc -> return (Just doc) _otherwise -> throwE "multiple -p/--prologue options" |