Commit 804868f
committed
[ fixed #71 ] do not produce tokens of length 0
Changed `alex_scan_tkn` to return `AlexNone` instead of `AlexLastAcc` or
`AlexLastSkip` if length of newly processed input is still 0.
This fixes the problem that Alex would produce an infinite sequence of
tokens of length 0 when the DFA was stuck in a state accepting a
nullable token.
Now it will either produce EOF (if at end of input) or a lexer error (if
not at the end of input). This is the intuitively expected behavior.1 parent 6c4db72 commit 804868f
2 files changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 36 | + | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
| |||
0 commit comments