Hi,
Effectively the input string "foo bar" is output as "foobar" by getText.
So for my project (where in some cases I need the original including the spaces) I wrote a getSourceText function that retrieves the substring of the underlying source instead of concatenating the parsed tokens (like getText() does).
As a test I implemented this first in my project
And to see if it would be a usable fit I implemented it as a new method in antlr4 itself.
Now before I put effort into writing tests and ensuring the code is clean:
Is this an enhancement that is desirable in ANTLR?
Or is this a call that should not go into ANTLR a be a part of the specific application?
Niels Basjes