-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
add TokenStreamRewriter to Python2 runtime #1273
Conversation
@ericvergnaud this would be a nice addition. can you bless it? |
blessed |
1 similar comment
blessed |
iop.text += prevIop.text | ||
rewrites[i] = None | ||
# look for replaces where iop.index is in range; error | ||
prevReplaces = [op for op in rewrites[:i] if isinstance(rop, TokenStreamRewriter.ReplaceOp)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be is instance(op, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems you are right.
I'll fix that, and will add tests and will review the code again.
@lygav please add some tests, following https://github.com/antlr/antlr4/blob/master/doc/adding-tests.md |
@ericvergnaud Thank you for taking time to review the PR. |
@ericvergnaud Hello, although TokenStreamRewriter belongs to the 'runtime' it looks like TokenStreamRewriter has tests only as part of the "tool" testsuite, and only for Java.
|
Hi, |
Thanks Eric, i am going to try to figure this out. |
@lygav I'll move my java tests to runtime. |
Actually, it looks like a major pain to make this general. So far we test ANTLR itself and not runtime lib stuff that is accessed only with code. I'm not sure it's worth the effort for me at this time to make a general mechanism. It would be easier to have runtime tests access just library stuff in the target language. Better than not having tests I guess. @ericvergnaud open to suggestions. |
Ok so let's leave as is and create independent tests in the respective runtimes. |
Hello @ericvergnaud and @parrt , please look into the pull request with all the tests Thank you |
Hello, i've added the TokenStreamRewriter to Python2 runtime.
If all goes well i hope to expand on this contribution.
Please advise about how to integrate into the auto-generated test suit if this is necessary.
P.S: Closes ISSUE #1115