| 199 | | symbol s |
| 200 | | | isWordAny (last s) = try $ do |
| 201 | | rv <- string s |
| 202 | | choice [ eof >> return ' ', lookAhead (satisfy (aheadWord $ last s)) ] |
| 203 | | whiteSpace |
| 204 | | return rv |
| 205 | | | otherwise = try $ do |
| 206 | | rv <- string s |
| 207 | | -- XXX Wrong - the correct solution is to lookahead as much as possible |
| 208 | | -- in the expression parser below |
| 209 | | choice [ eof >> return ' ', lookAhead (satisfy (aheadSym $ last s)) ] |
| 210 | | whiteSpace |
| 211 | | return rv |
| | 199 | symbol s = try $ do |
| | 200 | rv <- string s |
| | 201 | let ahead = if isWordAny lastCh then aheadWord else aheadSym |
| | 202 | lastCh = last rv |
| | 203 | choice [ lookAhead (satisfy (ahead lastCh)), eof >> return ' ' ] |
| | 204 | whiteSpace |
| | 205 | return rv |