Better support for non-ASCII
Getty Ritter
8 years ago
12 | 12 | } |
13 | 13 | |
14 | 14 | %wrapper "monadUserState" |
15 | ||
16 | $special = [ \{ \} \[ \] \( \) \; \, \+ \& \- \$ ] | |
17 | $idchar = $printable # $special | |
15 | 18 | |
16 | 19 | tokens :- |
17 | 20 | $white+ ; |
32 | 35 | |
33 | 36 | \-\> { lex' TkArrow } |
34 | 37 | |
35 |
|
|
38 | $idchar + { lex (TkText . T.strip) } | |
36 | 39 | |
37 |
\$ |
|
40 | \$ $idchar + { lex (TkJoin . T.strip) } | |
38 | 41 | |
39 | 42 | { |
40 | 43 | data Token = Token AlexPosn TkType deriving (Eq, Show) |