Commit 2406774
fix: Allow CommonTokenStream to reset properly
- There is a flag in CommonTokenStream that indicates whether EOF has
already been fetched/seen. This was not being reset when a new TokenSource
was given to an existing CommonTokenStream and there was no Reset() function
which was unfortunately not exported and not part of the interface for TokenStream.
- Reset the flag when a new source is provided
- Export the Reset() function so that a TokenStream can be rewound
Signed-off-by: Jim.Idle <[email protected]>1 parent 3aff09a commit 2406774
File tree
3 files changed
+6
-2
lines changed- runtime/Go/antlr/v4
3 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
0 commit comments