From 1402b19b0d1e4f07cd29397b0290cd1fb64932c9 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 13 May 2002 10:14:22 +0000 Subject: [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. --- src/HaddockParse.y | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/HaddockParse.y b/src/HaddockParse.y index dfb1a116..789f0d94 100644 --- a/src/HaddockParse.y +++ b/src/HaddockParse.y @@ -56,12 +56,7 @@ seq :: { ParsedDoc } | elem { $1 } elem :: { 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 } + : elem1 { $1 } | '@' seq1 '@' { DocMonospaced $2 } seq1 :: { ParsedDoc } @@ -72,10 +67,13 @@ elem1 :: { ParsedDoc } : STRING { DocString $1 } | '/' STRING '/' { DocEmphasis (DocString $2) } | URL { DocURL $1 } - | SQUO STRING SQUO { DocIdentifier $2 } - | BQUO STRING SQUO { DocIdentifier $2 } + | squo STRING squo { DocIdentifier $2 } | DQUO STRING DQUO { DocModule $2 } +squo :: { () } + : SQUO { () } + | BQUO { () } + { happyError :: [Token] -> Either String a happyError toks = -- cgit v1.2.3