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

support for TokenStreamRewriter.getText(ParserRuleContext) #727

Closed
wants to merge 3 commits into from
Closed

support for TokenStreamRewriter.getText(ParserRuleContext) #727

wants to merge 3 commits into from

Conversation

petrbel
Copy link
Contributor

@petrbel petrbel commented Oct 2, 2014

The getText method of TokenStreamRewriter now supports ParserRuleContext and TerminalNode as parameter, so one can use

myRewriter.getText("myProgram", ctx);

instead of

myRewriter.getText("myProgram", ctx.getSourceInterval());

@sharwell
Copy link
Member

sharwell commented Oct 2, 2014

Why not combine them into a single pair of methods which uses SyntaxTree as the parameter type?

@sharwell
Copy link
Member

sharwell commented Oct 2, 2014

Do you know what the relation between this and #505 is? I've been working my way through that (but slowly since I haven't needed to use TokenStreamRewriter myself before).

@petrbel
Copy link
Contributor Author

petrbel commented Oct 2, 2014

You're right, SyntaxTree is more general case. Issue #505 is interesting approach - I hope that some day we will be able to modify syntax trees in an elegant way. My commit is more like shortcut for friendlier usage of getText.

@parrt
Copy link
Member

parrt commented Nov 16, 2014

Issue #550 is also an issue related to the token stream rewriter so I won't merge this until I looked both of these at once.

@parrt parrt closed this Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants