aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Parse.y
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2010-04-07 17:05:20 +0000
committerDavid Waern <david.waern@gmail.com>2010-04-07 17:05:20 +0000
commitae37c71b42a81ad52b96eda5a765b6ade8dfd291 (patch)
tree80c92b784a7b37b5e8942aeb618b10edeceb5149 /src/Haddock/Parse.y
parentb5ec4e7d0f847215677752b191677379f045efb0 (diff)
Propagate source positions from Lex.x to Parse.y
Diffstat (limited to 'src/Haddock/Parse.y')
-rw-r--r--src/Haddock/Parse.y42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y
index d1146da3..1aad3a18 100644
--- a/src/Haddock/Parse.y
+++ b/src/Haddock/Parse.y
@@ -20,26 +20,26 @@ import Data.List (stripPrefix)
%expect 0
-%tokentype { Token }
-
-%token '/' { TokSpecial '/' }
- '@' { TokSpecial '@' }
- '[' { TokDefStart }
- ']' { TokDefEnd }
- DQUO { TokSpecial '\"' }
- URL { TokURL $$ }
- PIC { TokPic $$ }
- ANAME { TokAName $$ }
- '/../' { TokEmphasis $$ }
- '-' { TokBullet }
- '(n)' { TokNumber }
- '>..' { TokBirdTrack $$ }
- PROMPT { TokExamplePrompt $$ }
- RESULT { TokExampleResult $$ }
- EXP { TokExampleExpression $$ }
- IDENT { TokIdent $$ }
- PARA { TokPara }
- STRING { TokString $$ }
+%tokentype { LToken }
+
+%token '/' { (TokSpecial '/',_) }
+ '@' { (TokSpecial '@',_) }
+ '[' { (TokDefStart,_) }
+ ']' { (TokDefEnd,_) }
+ DQUO { (TokSpecial '\"',_) }
+ URL { (TokURL $$,_) }
+ PIC { (TokPic $$,_) }
+ ANAME { (TokAName $$,_) }
+ '/../' { (TokEmphasis $$,_) }
+ '-' { (TokBullet,_) }
+ '(n)' { (TokNumber,_) }
+ '>..' { (TokBirdTrack $$,_) }
+ PROMPT { (TokExamplePrompt $$,_) }
+ RESULT { (TokExampleResult $$,_) }
+ EXP { (TokExampleExpression $$,_) }
+ IDENT { (TokIdent $$,_) }
+ PARA { (TokPara,_) }
+ STRING { (TokString $$,_) }
%monad { Maybe }
@@ -117,7 +117,7 @@ strings :: { String }
| STRING strings { $1 ++ $2 }
{
-happyError :: [Token] -> Maybe a
+happyError :: [LToken] -> Maybe a
happyError toks = Nothing
-- | Create an 'Example', stripping superfluous characters as appropriate