From 052de51c3391c8a55539005a806f2c46f9ae2750 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 10 Apr 2002 13:23:13 +0000 Subject: [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. --- src/HaddockParse.y | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/HaddockParse.y') diff --git a/src/HaddockParse.y b/src/HaddockParse.y index 9411ff44..668e7d28 100644 --- a/src/HaddockParse.y +++ b/src/HaddockParse.y @@ -12,8 +12,7 @@ import HaddockTypes '/' { TokSpecial '/' } '[' { TokSpecial '[' } ']' { TokSpecial ']' } - '<' { TokSpecial '<' } - '>' { TokSpecial '>' } + URL { TokURL $$ } '*' { TokBullet } '(n)' { TokNumber } PARA { TokPara } @@ -48,11 +47,11 @@ seq :: { ParsedDoc } elem :: { ParsedDoc } : STRING { DocString $1 } | '/' STRING '/' { DocEmphasis (DocString $2) } - | '<' STRING '>' { DocURL $2 } + | URL { DocURL $1 } | SQUO STRING SQUO { DocIdentifier $2 } | DQUO STRING DQUO { DocModule $2 } | '[' seq ']' { DocMonospaced $2 } { -happyError = error "Parse error in doc string" +happyError toks = error ("parse error in doc string: " ++ show (take 3 toks)) } -- cgit v1.2.3