currently, FormattingWriter only fast-forwards AntlrTokens. I noticed now that this leads to problems; for example, the ,s in a PositionalArgumentList are written as "," (that is, as String instead of as AntlrToken). Of course, they are still in the TokenStream, and the next fastForward will break on them.
I’m not sure how to solve this. Should I change addToken to fast-forward in any case? This wouldn’t be difficult: The fast-forward tokenConsumer only uses token.text, which would be replaced by token for strings. Or should I try to somehow pry the , from the TokenStream in order to be able to give it to addToken for proper fast-forwarding?
I’m leaning towards the first solution, not only because I’m lazy, but also because trying to somehow get the , token will make the visitor much less readable.
currently, FormattingWriter only fast-forwards
AntlrToken
s. I noticed now that this leads to problems; for example, the,
s in aPositionalArgumentList
are written as","
(that is, asString
instead of asAntlrToken
). Of course, they are still in theTokenStream
, and the nextfastForward
will break on them.I’m not sure how to solve this. Should I change
addToken
to fast-forward in any case? This wouldn’t be difficult: The fast-forwardtokenConsumer
only usestoken.text
, which would be replaced bytoken
for strings. Or should I try to somehow pry the,
from theTokenStream
in order to be able to give it toaddToken
for proper fast-forwarding?