Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow CommonTokenStream to reset properly #4245

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

jimidle
Copy link
Collaborator

@jimidle jimidle commented Apr 23, 2023

fix: Implement Reset in TokenStream interface and fix both it and SetTokenSource

ping: @parrt

  - 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 <jimi@idle.ws>
@parrt parrt added this to the 4.12.1 milestone Apr 23, 2023
@parrt parrt merged commit 2406774 into antlr:dev Apr 23, 2023
@jimidle jimidle deleted the feature/tokenfix branch April 24, 2023 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants