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

get rid of snapshotLength and hasNewContent #1576

Merged
merged 5 commits into from
Oct 7, 2017

Conversation

monperrus
Copy link
Collaborator

fix #1567

@pvojtechovsky
Copy link
Collaborator

I wonder that conditions detecting whether . is needed are so simple! And all tests passed! You know the spoon really well!!! ;-)
Thank you @monperrus

@monperrus
Copy link
Collaborator Author

I was myself quite surprised that it works out-of-the-box!

scan(target);
if (printer.getPrinterHelper().hasNewContent()) {
// the implicit drives the separator
if (!target.isImplicit()) {
printer.writeSeparator(".");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move scan call above into this if block?
Then it is clear when it produces output.

@pvojtechovsky
Copy link
Collaborator

pvojtechovsky commented Oct 7, 2017

And please uncomment the last line of token writer printer test. It should pass now.

@INRIA INRIA deleted a comment from spoon-bot Oct 7, 2017
scan(invocation.getTarget());
if (printer.getPrinterHelper().hasNewContent()) {
if (invocation.getTarget() != null && !invocation.getTarget().isImplicit()) {
printer.writeSeparator(".");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this call of scan?

@INRIA INRIA deleted a comment from spoon-bot Oct 7, 2017
@INRIA INRIA deleted a comment from spoon-bot Oct 7, 2017
@INRIA INRIA deleted a comment from spoon-bot Oct 7, 2017
@pvojtechovsky
Copy link
Collaborator

It is OK for me. Let me know if you are finished. I will merge it then.

@monperrus
Copy link
Collaborator Author

monperrus commented Oct 7, 2017 via email

@pvojtechovsky pvojtechovsky merged commit 9d6de68 into INRIA:master Oct 7, 2017
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.

refactor: get rid of snapshotLength and hasNewContent
2 participants