diff options
author | David Waern <david.waern@gmail.com> | 2009-11-28 22:16:16 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2009-11-28 22:16:16 +0000 |
commit | 295a27b7558cf4fae144e3cf01e488e54ca961f2 (patch) | |
tree | d549700783fdd1fe3743428278684addd7779f92 /src/Haddock/Interface/Parse.y | |
parent | fba37778cd3eb564c83f1a35e922b8a0a9f111ea (diff) |
Move H.Interface.Parse/Lex to H.Parse/Lex
These are not just used to build Interfaces.
Diffstat (limited to 'src/Haddock/Interface/Parse.y')
-rw-r--r-- | src/Haddock/Interface/Parse.y | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/Haddock/Interface/Parse.y b/src/Haddock/Interface/Parse.y deleted file mode 100644 index a5175ddc..00000000 --- a/src/Haddock/Interface/Parse.y +++ /dev/null @@ -1,106 +0,0 @@ -{ -{-# OPTIONS -Wwarn -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - -module Haddock.Interface.Parse ( - parseHaddockParagraphs, - parseHaddockString -) where - -import Haddock.Interface.Lex -import Haddock.Types (Doc(..)) -import Haddock.Doc -import HsSyn -import RdrName -} - -%expect 0 - -%tokentype { Token } - -%token '/' { TokSpecial '/' } - '@' { TokSpecial '@' } - '[' { TokDefStart } - ']' { TokDefEnd } - DQUO { TokSpecial '\"' } - URL { TokURL $$ } - PIC { TokPic $$ } - ANAME { TokAName $$ } - '/../' { TokEmphasis $$ } - '-' { TokBullet } - '(n)' { TokNumber } - '>..' { TokBirdTrack $$ } - IDENT { TokIdent $$ } - PARA { TokPara } - STRING { TokString $$ } - -%monad { Maybe } - -%name parseHaddockParagraphs doc -%name parseHaddockString seq - -%% - -doc :: { Doc RdrName } - : apara PARA doc { docAppend $1 $3 } - | PARA doc { $2 } - | apara { $1 } - | {- empty -} { DocEmpty } - -apara :: { Doc RdrName } - : ulpara { DocUnorderedList [$1] } - | olpara { DocOrderedList [$1] } - | defpara { DocDefList [$1] } - | para { $1 } - -ulpara :: { Doc RdrName } - : '-' para { $2 } - -olpara :: { Doc RdrName } - : '(n)' para { $2 } - -defpara :: { (Doc RdrName, Doc RdrName) } - : '[' seq ']' seq { ($2, $4) } - -para :: { Doc RdrName } - : seq { docParagraph $1 } - | codepara { DocCodeBlock $1 } - -codepara :: { Doc RdrName } - : '>..' codepara { docAppend (DocString $1) $2 } - | '>..' { DocString $1 } - -seq :: { Doc RdrName } - : elem seq { docAppend $1 $2 } - | elem { $1 } - -elem :: { Doc RdrName } - : elem1 { $1 } - | '@' seq1 '@' { DocMonospaced $2 } - -seq1 :: { Doc RdrName } - : PARA seq1 { docAppend (DocString "\n") $2 } - | elem1 seq1 { docAppend $1 $2 } - | elem1 { $1 } - -elem1 :: { Doc RdrName } - : STRING { DocString $1 } - | '/../' { DocEmphasis (DocString $1) } - | URL { DocURL $1 } - | PIC { DocPic $1 } - | ANAME { DocAName $1 } - | IDENT { DocIdentifier $1 } - | DQUO strings DQUO { DocModule $2 } - -strings :: { String } - : STRING { $1 } - | STRING strings { $1 ++ $2 } - -{ -happyError :: [Token] -> Maybe a -happyError toks = Nothing -} |