aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Lex.x
diff options
context:
space:
mode:
authorSimon Hengel <sol@typeful.net>2012-10-09 12:41:25 +0200
committerSimon Hengel <sol@typeful.net>2012-10-09 12:45:31 +0200
commitdfbe1c45879d8ae32845c72e5ae241fb1c6fe502 (patch)
treef32417c55bfeb4d2fa420e5fe688ad4a1eda5808 /src/Haddock/Lex.x
parent72675c1bf281b81041a19014b1b7df03a0de9488 (diff)
Simplify lexing/parsing of properties
In contrast to what we do for examples, we do not really need to capture the "prompt" here.
Diffstat (limited to 'src/Haddock/Lex.x')
-rw-r--r--src/Haddock/Lex.x10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x
index 35e6dd8a..aec4c647 100644
--- a/src/Haddock/Lex.x
+++ b/src/Haddock/Lex.x
@@ -50,7 +50,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<0,para> {
$ws* \n ;
$ws* \> { begin birdtrack }
- $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr }
+ $ws* prop \> .* \n { strtoken TokProperty }
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
$ws* [\*\-] { token TokBullet `andBegin` string }
$ws* \[ { token TokDefStart `andBegin` def }
@@ -62,7 +62,6 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
-- beginning of a line
<line> {
$ws* \> { begin birdtrack }
- $ws* prop\> { strtoken TokPropertyPrompt `andBegin` propertyexpr }
$ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr }
$ws* \n { token TokPara `andBegin` para }
-- Here, we really want to be able to say
@@ -86,10 +85,6 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:]
<exampleresult> .* \n { strtokenNL TokExampleResult `andBegin` example }
-<propertyexpr> .* \n { strtokenNL TokPropertyExpression `andBegin` property }
-
-<property> () { token TokPara `andBegin` para }
-
<string,def> {
$special { strtoken $ \s -> TokSpecial (head s) }
\<\< [^\>]* \>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) }
@@ -135,8 +130,7 @@ data Token
| TokEmphasis String
| TokAName String
| TokBirdTrack String
- | TokPropertyPrompt String
- | TokPropertyExpression String
+ | TokProperty String
| TokExamplePrompt String
| TokExampleExpression String
| TokExampleResult String