aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockLex.x
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-08-19 09:09:03 +0000
committersimonmar <unknown>2003-08-19 09:09:03 +0000
commitd5f6a4b53fdd82b8ff89687672a5e91a082b635d (patch)
treee29c28178d05894afd4b0b850b4edc00028e7317 /src/HaddockLex.x
parentea54ebc01fc0a448ed523530a3a52271191337f1 (diff)
[haddock @ 2003-08-19 09:09:03 by simonmar]
Further wibbles to the syntax.
Diffstat (limited to 'src/HaddockLex.x')
-rw-r--r--src/HaddockLex.x12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/HaddockLex.x b/src/HaddockLex.x
index 0c606bdf..feac18ab 100644
--- a/src/HaddockLex.x
+++ b/src/HaddockLex.x
@@ -34,12 +34,11 @@ $ident = [$alphanum \_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~]
$ws* { begin string }
}
--- beginning of a line: don't ignore whitespace, unless this is the start
--- of a new paragraph.
+-- beginning of a line
<line> {
$ws* \> { begin birdtrack }
$ws* \n { token TokPara `andBegin` para }
- () { begin string }
+ $ws* { begin string }
}
<birdtrack> .* \n? { strtoken TokBirdTrack `andBegin` line }
@@ -50,8 +49,9 @@ $ident = [$alphanum \_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~]
\#.*\# { strtoken $ \s -> TokAName (init (tail s)) }
[\'\`] $ident+ [\'\`] { ident }
\\ . { strtoken (TokString . tail) }
- -- allow single-quotes to be literal if they don't surround identifiers
- [\'\`] { strtoken TokString }
+ -- allow special characters through if they don't fit one of the previous
+ -- patterns.
+ [\'\`\<\#\\] { strtoken TokString }
[^ $special \< \# \n \'\` \\]* \n { strtoken TokString `andBegin` line }
[^ $special \< \# \n \'\` \\]+ { strtoken TokString }
}
@@ -83,7 +83,7 @@ alexGetChar (_, c:cs) = Just (c, (c,cs))
alexInputPrevChar (c,_) = c
tokenise :: String -> [Token]
-tokenise str = let toks = go ('\n',str) para in {- trace (show toks) -} toks
+tokenise str = let toks = go ('\n',str) para in {-trace (show toks)-} toks
where go inp@(_,str) sc =
case alexScan inp sc of
AlexEOF -> []