- input <- getInput
- case alexGetChar input of
- Nothing -> error "Can't happen"
- Just ('|', input) -> lexDocComment input ITdocCommentNext False
- Just ('^', input) -> lexDocComment input ITdocCommentPrev False
- Just ('$', input) -> lexDocComment input ITdocCommentNamed False
- Just ('*', input) -> lexDocSection 1 input
+ input@(AI _ _ buf) <- getInput
+ case prevChar buf ' ' of
+ '|' -> lexDocComment input ITdocCommentNext False
+ '^' -> lexDocComment input ITdocCommentPrev False
+ '$' -> lexDocComment input ITdocCommentNamed False
+ '*' -> lexDocSection 1 input