aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-11-28 22:16:16 +0000
committerDavid Waern <david.waern@gmail.com>2009-11-28 22:16:16 +0000
commit295a27b7558cf4fae144e3cf01e488e54ca961f2 (patch)
treed549700783fdd1fe3743428278684addd7779f92
parentfba37778cd3eb564c83f1a35e922b8a0a9f111ea (diff)
Move H.Interface.Parse/Lex to H.Parse/Lex
These are not just used to build Interfaces.
-rw-r--r--haddock.cabal4
-rw-r--r--src/Haddock/Interface/LexParseRn.hs8
-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.hs6
5 files changed, 16 insertions, 18 deletions
diff --git a/haddock.cabal b/haddock.cabal
index 59b68c9e..b79b7b86 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -100,11 +100,11 @@ executable haddock
Haddock.Interface.Create
Haddock.Interface.ExtractFnArgDocs
Haddock.Interface.AttachInstances
- Haddock.Interface.Lex
- Haddock.Interface.Parse
Haddock.Interface.Rn
Haddock.Interface.LexParseRn
Haddock.Interface.ParseModuleHeader
+ Haddock.Lex
+ Haddock.Parse
Haddock.Utils.BlockTable
Haddock.Utils.Html
Haddock.Utils
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"