diff options
author | simonmar <unknown> | 2002-04-10 13:23:13 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-04-10 13:23:13 +0000 |
commit | 052de51c3391c8a55539005a806f2c46f9ae2750 (patch) | |
tree | fe8e5a771c95dea2d6a5e8cb5c8618a06a69933a /src/HaddockParse.y | |
parent | 9e83c54df01ff0de10fc1a6cfc88a6cb93cdec1d (diff) |
[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.
Diffstat (limited to 'src/HaddockParse.y')
-rw-r--r-- | src/HaddockParse.y | 7 |
1 files changed, 3 insertions, 4 deletions
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)) } |