diff options
Diffstat (limited to 'src/HaddockParse.y')
-rw-r--r-- | src/HaddockParse.y | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/HaddockParse.y b/src/HaddockParse.y index 87fb1af6..dfb1a116 100644 --- a/src/HaddockParse.y +++ b/src/HaddockParse.y @@ -8,10 +8,10 @@ import HaddockTypes %tokentype { Token } %token SQUO { TokSpecial '\'' } + BQUO { TokSpecial '`' } DQUO { TokSpecial '\"' } '/' { TokSpecial '/' } - '[' { TokSpecial '[' } - ']' { TokSpecial ']' } + '@' { TokSpecial '@' } URL { TokURL $$ } '*' { TokBullet } '(n)' { TokNumber } @@ -60,8 +60,21 @@ elem :: { ParsedDoc } | '/' STRING '/' { DocEmphasis (DocString $2) } | URL { DocURL $1 } | SQUO STRING SQUO { DocIdentifier $2 } + | BQUO STRING SQUO { DocIdentifier $2 } + | DQUO STRING DQUO { DocModule $2 } + | '@' seq1 '@' { DocMonospaced $2 } + +seq1 :: { ParsedDoc } + : elem1 seq1 { docAppend $1 $2 } + | elem1 { $1 } + +elem1 :: { ParsedDoc } + : STRING { DocString $1 } + | '/' STRING '/' { DocEmphasis (DocString $2) } + | URL { DocURL $1 } + | SQUO STRING SQUO { DocIdentifier $2 } + | BQUO STRING SQUO { DocIdentifier $2 } | DQUO STRING DQUO { DocModule $2 } - | '[' seq ']' { DocMonospaced $2 } { happyError :: [Token] -> Either String a |